-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate from TSLint to ESLint + Prettier
- Loading branch information
1 parent
12a4d36
commit fa9c859
Showing
7 changed files
with
838 additions
and
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,73 @@ | ||
{ | ||
"env": { | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"prettier", | ||
"prettier/@typescript-eslint" | ||
], | ||
"rules": { | ||
// "linebreak-style": ["error", "windows"], | ||
"@typescript-eslint/require-await": "off", | ||
"@typescript-eslint/camelcase": "off", | ||
"@typescript-eslint/no-explicit-any": "off" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"**/__tests__/**", | ||
"**/__integration_tests__/**", | ||
"**/*.test.ts" | ||
], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
// relaxed settings for tests - any test is better than no test! | ||
"no-useless-catch": "warn", | ||
"@typescript-eslint/prefer-includes": "warn", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@typescript-eslint/prefer-regexp-exec": "warn", | ||
"@typescript-eslint/no-inferrable-types": "warn", | ||
"require-atomic-updates": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/unbound-method": "off", | ||
"@typescript-eslint/no-use-before-define": "off" | ||
} | ||
} | ||
] | ||
"env": { | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint", "prettier"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
// "plugin:prettier/recommended", // need to be uncommented on full run | ||
"prettier/@typescript-eslint" | ||
], | ||
"rules": { | ||
// Following line need to be uncommented before full run in separated PR | ||
// "linebreak-style": ["error", "windows"], | ||
"@typescript-eslint/require-await": "off", | ||
"@typescript-eslint/camelcase": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
// ---------- tslint.json rules ------------- | ||
// not enforced by abode presets | ||
"@typescript-eslint/prefer-for-of": "error", | ||
"@typescript-eslint/unified-signatures": "error", | ||
"@typescript-eslint/prefer-namespace-keyword": "error", | ||
// were switched off in TSLint config | ||
"@typescript-eslint/explicit-member-accessibility": [ | ||
"off", | ||
{ | ||
"overrides": { | ||
"constructors": "off" | ||
} | ||
} | ||
], | ||
"@typescript-eslint/array-type": "off", | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/member-ordering": "off", | ||
// existing errors lowered to warn - NEED TO REFACTOR later | ||
"no-prototype-builtins": "warn", | ||
"@typescript-eslint/no-inferrable-types": "warn" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["**/__tests__/**", "**/__integration_tests__/**", "**/*.test.ts"], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
// relaxed settings for tests - any test is better than no test! | ||
"no-useless-catch": "warn", | ||
"no-useless-escape": "warn", | ||
"@typescript-eslint/prefer-includes": "warn", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@typescript-eslint/prefer-regexp-exec": "warn", | ||
"@typescript-eslint/no-inferrable-types": "warn", | ||
"@typescript-eslint/array-type": "warn", | ||
"require-atomic-updates": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/unbound-method": "off", | ||
"@typescript-eslint/no-use-before-define": "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,27 @@ | ||
{ | ||
"printWidth": 100, | ||
"endOfLine": "crlf", | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"semi": true, | ||
"useTabs": true, | ||
"tabWidth": 1, | ||
"arrowParens": "always", | ||
"overrides": [ | ||
{ | ||
"files": ["*.yml", "*.sh", "*.json"], | ||
"options": { | ||
"singleQuote": false, | ||
"useTabs": false, | ||
"endOfLine": "lf", | ||
"tabWidth": 2 | ||
} | ||
}, | ||
{ | ||
"files": ["package.json", "package-lock.json"], | ||
"options": { | ||
"parser": "json-stringify" | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -1,23 +1,29 @@ | ||
{ | ||
"files.eol": "\r\n", | ||
"editor.insertSpaces": false, | ||
// prevent Jest extension to run automatically on our integration tests | ||
"jest.autoEnable": false, | ||
"jest.runAllTestsFirst": false, | ||
"jest.debugCodeLens.showWhenTestStateIn": ["pass", "fail", "unknown"], | ||
"[json]": { | ||
"files.eol": "\n", | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 2 | ||
}, | ||
"[yaml]": { | ||
"files.eol": "\n", | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 2 | ||
}, | ||
"[shellscript]": { | ||
"files.eol": "\n", | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 2 | ||
} | ||
"files.eol": "\r\n", | ||
"editor.insertSpaces": false, | ||
"[json]": { | ||
"files.eol": "\n", | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 2 | ||
}, | ||
"[yaml]": { | ||
"files.eol": "\n", | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 2 | ||
}, | ||
"[shellscript]": { | ||
"files.eol": "\n", | ||
"editor.insertSpaces": true, | ||
"editor.tabSize": 2 | ||
}, | ||
// prevent Jest extension to run automatically on our integration tests | ||
"jest.autoEnable": false, | ||
"jest.runAllTestsFirst": false, | ||
"jest.debugCodeLens.showWhenTestStateIn": ["pass", "fail", "unknown"], | ||
// ESlint Options | ||
"eslint.autoFixOnSave": true, | ||
"eslint.run": "onType", | ||
"eslint.validate": ["javascript", "typescript"], | ||
// we run prettier from ESLint, so, disable it from separated extension | ||
"prettier.disableLanguages": ["typescript"] | ||
} |
Oops, something went wrong.