-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to common ESlint configuration (#68)
* Install commons from verdaccio * Fix lint issues in pusher * Fix lint issues in api * Fix lint issues in common * Fix lint issues in e2e * Finish eslint migration * Finish eslint migration * Update to latest commons eslint * Use released package
- Loading branch information
Showing
53 changed files
with
1,127 additions
and
384 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,72 +1,6 @@ | ||
module.exports = { | ||
root: true, // https://github.com/eslint/eslint/issues/13385#issuecomment-641252879 | ||
env: { | ||
es6: true, | ||
jest: true, | ||
node: true, | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
extends: ['./node_modules/@api3/commons/dist/eslint/universal', './node_modules/@api3/commons/dist/eslint/jest'], | ||
parserOptions: { | ||
ecmaVersion: 11, | ||
sourceType: 'module', | ||
}, | ||
globals: { | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:import/recommended', | ||
'plugin:import/typescript', | ||
'plugin:jest/recommended', | ||
], | ||
plugins: ['@typescript-eslint', 'import', 'jest'], | ||
rules: { | ||
// TypeScript | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/ban-ts-ignore': 'off', | ||
'@typescript-eslint/ban-types': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
// Turning off, because it conflicts with prettier | ||
'@typescript-eslint/indent': ['off'], | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
// Leave vars as 'all' to force everything to be handled when pattern matching | ||
// Variables can be ignored by prefixing with an '_' | ||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', vars: 'all' }], | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
|
||
// eslint-plugin-import | ||
'import/namespace': ['error', { allowComputed: true }], | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: ['builtin', 'external', 'internal', 'sibling', 'parent', 'index', 'object', 'type'], | ||
pathGroups: [ | ||
{ | ||
pattern: 'mock-utils', | ||
group: 'builtin', | ||
patternOptions: { matchBase: true, nocomment: true }, | ||
}, | ||
], | ||
}, | ||
], | ||
|
||
// ESLint | ||
'comma-dangle': ['error', 'only-multiline'], | ||
indent: 'off', | ||
'no-console': 'error', | ||
'no-useless-escape': 'off', | ||
semi: 'error', | ||
eqeqeq: ['error', 'smart'], | ||
|
||
// Jest | ||
'jest/valid-title': 'off', // Prevents using "<function-name>.name" as a test name | ||
project: ['./tsconfig.json', './packages/*/tsconfig.json'], | ||
}, | ||
}; |
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
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
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
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
Oops, something went wrong.