-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrating from tslint to eslint
tslint has been deprecated. Using eslint as standard linter for Angular. BREAKING CHANGE: eslint as default linter
- Loading branch information
Showing
8 changed files
with
1,688 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,288 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2020": true | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"extends": ["plugin:@angular-eslint/recommended"], | ||
"overrides": [ | ||
{ | ||
// general | ||
"files": ["*.ts"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["eslint-plugin-prefer-arrow", "jsdoc"], | ||
"extends": [ | ||
// "eslint:recommended", | ||
// "plugin:@typescript-eslint/recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings", | ||
"plugin:import/typescript", | ||
"plugin:jsdoc/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/dot-notation": "warn", | ||
"import/no-deprecated": "warn", | ||
"import/no-extraneous-dependencies": "error", | ||
"import/no-internal-modules": [ | ||
// https://github.com/benmosher/eslint-plugin-import/issues/1430 | ||
"off", | ||
{ | ||
"allow": [ | ||
"rxjs/*", | ||
"@angular/platform-browser/*", | ||
"@angular/core/testing/*", | ||
"@angular/core/testing", | ||
"@angular/router/testing/*", | ||
"@angular/platform-browser-dynamic/*", | ||
"zone.js/**" | ||
] | ||
} | ||
], | ||
"import/order": "warn", | ||
"import/no-unresolved": "error", | ||
"import/named": "error", | ||
"import/no-self-import": "error", | ||
// TODO: NavigationFlowOutNode, NavigationFlow | ||
// "import/no-cycle": "error", | ||
"import/newline-after-import": "error" | ||
} | ||
}, | ||
{ | ||
// prettier | ||
"files": ["*.ts", "*.json"], | ||
"extends": ["plugin:prettier/recommended"] | ||
}, | ||
{ | ||
"files": ["*.component.ts"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@angular-eslint/template"], | ||
"processor": "@angular-eslint/template/extract-inline-html" | ||
} | ||
], | ||
"rules": { | ||
"@angular-eslint/component-class-suffix": "error", | ||
"@angular-eslint/component-selector": [ | ||
"error", | ||
{ | ||
"type": "element", | ||
"prefix": "app", | ||
"style": "kebab-case" | ||
} | ||
], | ||
"@angular-eslint/contextual-lifecycle": "error", | ||
"@angular-eslint/directive-class-suffix": "error", | ||
"@angular-eslint/directive-selector": [ | ||
"error", | ||
{ | ||
"type": "attribute", | ||
"prefix": "app", | ||
"style": "camelCase" | ||
} | ||
], | ||
"@angular-eslint/no-conflicting-lifecycle": "error", | ||
"@angular-eslint/no-host-metadata-property": "error", | ||
"@angular-eslint/no-input-rename": "error", | ||
"@angular-eslint/no-inputs-metadata-property": "error", | ||
"@angular-eslint/no-output-native": "error", | ||
"@angular-eslint/no-output-on-prefix": "error", | ||
"@angular-eslint/no-output-rename": "error", | ||
"@angular-eslint/no-outputs-metadata-property": "error", | ||
"@angular-eslint/use-component-view-encapsulation": "error", | ||
"@angular-eslint/use-lifecycle-interface": "error", | ||
"@angular-eslint/use-pipe-decorator": "error", | ||
"@angular-eslint/use-pipe-transform-interface": "error", | ||
"@typescript-eslint/adjacent-overload-signatures": "error", | ||
"@typescript-eslint/array-type": "warn", | ||
"@typescript-eslint/ban-types": [ | ||
"error", | ||
{ | ||
"types": { | ||
"Object": { | ||
"message": "Avoid using the `Object` type. Did you mean `object`?" | ||
}, | ||
"Function": { | ||
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." | ||
}, | ||
"Boolean": { | ||
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?" | ||
}, | ||
"Number": { | ||
"message": "Avoid using the `Number` type. Did you mean `number`?" | ||
}, | ||
"String": { | ||
"message": "Avoid using the `String` type. Did you mean `string`?" | ||
}, | ||
"Symbol": { | ||
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?" | ||
} | ||
} | ||
} | ||
], | ||
// Definition for rule "@typescript-eslint/class-name-casing" was not found | ||
"@typescript-eslint/class-name-casing": "off", | ||
"@typescript-eslint/consistent-type-assertions": "error", | ||
"@typescript-eslint/consistent-type-definitions": "error", | ||
// You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser. | ||
"@typescript-eslint/dot-notation": "off", | ||
"@typescript-eslint/explicit-member-accessibility": [ | ||
"off", | ||
{ | ||
"accessibility": "explicit" | ||
} | ||
], | ||
// using prettier as formater | ||
"@typescript-eslint/indent": "off", | ||
// Definition for rule "@typescript-eslint/interface-name-prefix" was not found | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"warn", | ||
{ | ||
"multiline": { | ||
"delimiter": "semi", | ||
"requireLast": true | ||
}, | ||
"singleline": { | ||
"delimiter": "semi", | ||
"requireLast": false | ||
} | ||
} | ||
], | ||
"@typescript-eslint/member-ordering": "error", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-inferrable-types": "error", | ||
"@typescript-eslint/no-misused-new": "error", | ||
"@typescript-eslint/no-namespace": "error", | ||
"@typescript-eslint/no-non-null-assertion": "error", | ||
"@typescript-eslint/no-parameter-properties": "off", | ||
"@typescript-eslint/no-this-alias": "off", | ||
"@typescript-eslint/no-unused-expressions": "error", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-var-requires": "warn", | ||
"@typescript-eslint/prefer-for-of": "error", | ||
"@typescript-eslint/prefer-function-type": "error", | ||
"@typescript-eslint/prefer-namespace-keyword": "error", | ||
"@typescript-eslint/quotes": "off", | ||
"@typescript-eslint/semi": ["error"], | ||
"@typescript-eslint/triple-slash-reference": [ | ||
"error", | ||
{ | ||
"path": "always", | ||
"types": "prefer-import", | ||
"lib": "always" | ||
} | ||
], | ||
"@typescript-eslint/type-annotation-spacing": "warn", | ||
"@typescript-eslint/unified-signatures": "error", | ||
"arrow-body-style": ["warn", "as-needed"], | ||
"arrow-parens": [ | ||
"warn", | ||
"as-needed", | ||
{ | ||
"requireForBlockBody": false | ||
} | ||
], | ||
"brace-style": ["off", "off"], | ||
"camelcase": "error", | ||
"comma-dangle": "off", | ||
"complexity": "off", | ||
"constructor-super": "error", | ||
"curly": "off", | ||
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md | ||
"dot-notation": "off", | ||
"eol-last": "off", | ||
"eqeqeq": ["error", "smart"], | ||
"guard-for-in": "error", | ||
// "id-blacklist": [ | ||
// "error", | ||
// "any", | ||
// "Number", | ||
// "number", | ||
// "String", | ||
// "string", | ||
// "Boolean", | ||
// "boolean", | ||
// "Undefined", | ||
// "undefined" | ||
// ], | ||
"id-match": "error", | ||
"linebreak-style": "off", | ||
"max-classes-per-file": "off", | ||
"max-len": "off", | ||
"new-parens": "off", | ||
"newline-per-chained-call": "off", | ||
"no-bitwise": "error", | ||
"no-caller": "error", | ||
"no-cond-assign": "error", | ||
"no-console": [ | ||
"error", | ||
{ | ||
"allow": ["error"] | ||
} | ||
], | ||
"no-debugger": "error", | ||
"no-duplicate-case": "error", | ||
"no-duplicate-imports": "error", | ||
"no-empty": "off", | ||
"no-eval": "error", | ||
"no-extra-bind": "error", | ||
"no-extra-semi": "off", | ||
"no-fallthrough": "error", | ||
"no-invalid-this": "off", | ||
"no-irregular-whitespace": "off", | ||
"no-multiple-empty-lines": "off", | ||
"no-new-func": "error", | ||
"no-new-wrappers": "error", | ||
"no-redeclare": "warn", | ||
"no-restricted-imports": ["error", "rxjs/Rx"], | ||
"no-return-await": "error", | ||
"no-sequences": "error", | ||
"no-shadow": [ | ||
"error", | ||
{ | ||
"hoist": "all" | ||
} | ||
], | ||
"no-sparse-arrays": "error", | ||
"no-template-curly-in-string": "error", | ||
"no-throw-literal": "error", | ||
"no-trailing-spaces": "off", | ||
"no-undef-init": "error", | ||
"no-underscore-dangle": "error", | ||
"no-unneeded-ternary": "error", | ||
"no-unsafe-finally": "error", | ||
"no-unused-labels": "error", | ||
"no-var": "error", | ||
"object-shorthand": "error", | ||
"one-var": ["error", "never"], | ||
// TODO: | ||
// "prefer-arrow/prefer-arrow-functions": "error", | ||
"prefer-const": "error", | ||
"prefer-object-spread": "error", | ||
"quotes": "off", | ||
"quote-props": "off", | ||
"radix": "error", | ||
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md | ||
"semi": "off", | ||
"space-before-function-paren": "off", | ||
"space-in-parens": ["off", "never"], | ||
"spaced-comment": [ | ||
"error", | ||
"always", | ||
{ | ||
"markers": ["/"] | ||
} | ||
], | ||
"use-isnan": "error", | ||
"valid-typeof": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"recommendations": [ | ||
"angular.ng-template", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"natewallace.angular2-inline", | ||
"cyrilletuzi.angular-schematics", | ||
"kamikillerto.vscode-colorize", | ||
"msjsdiag.debugger-for-chrome", | ||
"dbaeumer.vscode-eslintd", | ||
"oderwat.indent-rainbow", | ||
"2gua.rainbow-brackets", | ||
"mrmlnc.vscode-scss", | ||
"nrwl.angular-console", | ||
"editorconfig.editorconfig", | ||
"johnpapa.angular2", | ||
"christian-kohler.path-intellisense", | ||
"formulahendry.auto-close-tag", | ||
"gruntfuggly.todo-tree", | ||
"wayou.vscode-todo-highlight" | ||
] | ||
} |
Oops, something went wrong.