In progress...
Shareable Config
An ESLintPossible Errors
- for-direction error
- getter-return error
- no-await-in-loop error
- no-compare-neg-zero error
- no-cond-assign error
- no-console warn
- no-constant-condition off
- no-control-regex error
- no-debugger error
- no-dupe-args error
- no-dupe-keys error
- no-duplicate-case error
- no-empty error
- no-empty-character-class error
- no-ex-assign error
- no-extra-boolean-cast error
- no-extra-parens off
- no-extra-semi error
- no-func-assign error
- no-inner-declarations error | both
- no-invalid-regexp error
- no-irregular-whitespace
- no-obj-calls error
- no-prototype-builtins error
- no-regex-spaces error
- no-sparse-arrays error
- no-template-curly-in-string error
- no-unexpected-multiline error
- no-unreachable error
- no-unsafe-finally error
- no-unsafe-negation error
- use-isnan error
- valid-typeof error | requireStringLiterals
Stylistic Issues
- quotes error | single
Installation
Setup dependencies
npm install eslint
or
yarn add eslint
Setup devDependencies
npm install --save-dev eslint-config-und
or
yarn add eslint-config-und --dev
Implementacion for TypeScript and Webpack
npm install eslint-config-und eslint-loader eslint-plugin-typescript typescript-eslint-parser --save-dev
or
yarn add eslint-config-und eslint-loader eslint-plugin-typescript typescript-eslint-parser --dev
Add .eslintrc
file:
{
"parser": "typescript-eslint-parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"typescript"
],
"extends": "eslint-config-und"
}
Add a object into entry module.exports from webpack.config.js
{
enforce: 'pre',
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'eslint-loader'
}
So you can see eslint in acction:
It's all.