-
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.
* Improve ESLint config * Fix linter problems
- Loading branch information
1 parent
8a58806
commit 11e19b7
Showing
16 changed files
with
152 additions
and
64 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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/** | ||
* @file ESLint configuration based on Airbnb's with some modifications. | ||
*/ | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { join } = require('path'); | ||
|
||
const MAX_LINE_LENGTH = 120; | ||
|
||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'airbnb-base', | ||
'airbnb-typescript/base', | ||
'plugin:jsdoc/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
tsconfigRootDir: join(__dirname), | ||
project: 'tsconfig.eslint.json', | ||
}, | ||
plugins: ['import', '@typescript-eslint', 'import-newlines'], | ||
rules: { | ||
'max-len': [ | ||
'error', | ||
{ | ||
code: MAX_LINE_LENGTH, | ||
comments: MAX_LINE_LENGTH, | ||
tabWidth: 4, | ||
ignoreUrls: true, | ||
ignoreTrailingComments: false, | ||
ignoreComments: false, | ||
}, | ||
], | ||
'@typescript-eslint/indent': [ | ||
'error', | ||
4, | ||
{ | ||
SwitchCase: 1, | ||
}, | ||
], | ||
'jsdoc/multiline-blocks': ['error', { noSingleLineBlocks: true }], | ||
'import/prefer-default-export': 'off', | ||
'import-newlines/enforce': ['error', { items: 3, 'max-len': MAX_LINE_LENGTH }], | ||
// Split external and internal imports with an empty line | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: [ | ||
['builtin', 'external'], | ||
], | ||
'newlines-between': 'always', | ||
}, | ||
], | ||
// We can disable this, because we bundle everything | ||
'import/no-extraneous-dependencies': 'off', | ||
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'], | ||
'no-continue': 'off', | ||
'jsdoc/require-param-type': 'off', | ||
'jsdoc/require-returns-type': 'off', | ||
'jsdoc/tag-lines': [ | ||
'warn', | ||
'any', | ||
{ | ||
startLines: 1, | ||
}, | ||
], | ||
'arrow-body-style': 'off', | ||
'no-await-in-loop': 'off', | ||
// Force proper import and export of types | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'error', | ||
{ | ||
fixStyle: 'inline-type-imports', | ||
}, | ||
], | ||
'@typescript-eslint/consistent-type-exports': [ | ||
'error', | ||
{ | ||
fixMixedExportsWithInlineTypeSpecifier: true, | ||
}, | ||
], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
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
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