Skip to content

Instantly share code, notes, and snippets.

@guyisra
Created May 5, 2019 06:20
Show Gist options
  • Select an option

  • Save guyisra/e596ee3f59a77cee59b97048a5d8d20d to your computer and use it in GitHub Desktop.

Select an option

Save guyisra/e596ee3f59a77cee59b97048a5d8d20d to your computer and use it in GitHub Desktop.
// .eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
};
//.prettierrc.js
module.exports = {
semi: false,
trailingComma: 'none',
singleQuote: false,
printWidth: 120,
tabWidth: 2
};
//dev dependencies
"@typescript-eslint/eslint-plugin": "^1.7.0",
"@typescript-eslint/parser": "^1.7.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-prettier": "^3.0.1",
"prettier": "^1.17.0",
"typescript": "^3.4.4"
// .vscode settings
{
"prettier.eslintIntegration": true,
"eslint.validate": [
"javascript",
{"language": "typescript", "autoFix": true },
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment