gustavguez-eslint-config
v1.0.6
Published
Configuration for eslint
Downloads
4
Maintainers
Readme
gustavguez-eslint-config
Rules for eslint and typescript-eslint packages for an angular 2+ projects.
Extended rules
This package extends and configure the next packages:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
Install dependencies
Ensure this packages are installed:
$ npm i -D eslint @typescript-eslint/eslint-plugin
$ npm i -D eslint @typescript-eslint/parser
$ npm i -D eslint @typescript-eslint/eslint-plugin-tslint
Install
Install command:
$ npm i -D eslint gustavguez-eslint-config
Example of use
Ensure to place this code in .eslintrc.js in project root.
module.exports = {
extends: [
'gustavguez-eslint-config'
].map(require.resolve),
parserOptions: {
project: "tsconfig.json",
},
rules: {}
}
Executing ESLint
As a next step, in package.json file to add an ESLint command in “scripts” section.
"eslint": "eslint 'src/**/*.ts'"
Now you are able to run in console:
$ npm run eslint