Created
September 1, 2022 15:29
-
-
Save humodz/36dee7bd8c3bf6a2259cc828f537a6b8 to your computer and use it in GitHub Desktop.
eslint configuration
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
module.exports = { | |
extends: [ | |
'plugin:prettier/recommended', | |
'plugin:@typescript-eslint/recommended', | |
], | |
rules: { | |
'@typescript-eslint/interface-name-prefix': 'off', | |
'@typescript-eslint/explicit-function-return-type': 'off', | |
'@typescript-eslint/explicit-module-boundary-types': 'off', | |
'@typescript-eslint/no-explicit-any': 'off', | |
'@typescript-eslint/no-non-null-assertion': 'off', | |
'@typescript-eslint/unbound-method': 'error', | |
'@typescript-eslint/prefer-for-of': 'error', | |
'curly': ['error', 'all'], | |
'eqeqeq': ['error', 'always'], | |
'one-var': ['error', 'never'], | |
'@typescript-eslint/naming-convention': [ | |
'error', | |
{ | |
selector: 'default', | |
format: ['camelCase'], | |
leadingUnderscore: 'allow', | |
trailingUnderscore: 'allow', | |
}, | |
{ | |
selector: 'variable', | |
format: ['camelCase', 'UPPER_CASE'], | |
leadingUnderscore: 'allow', | |
trailingUnderscore: 'allow', | |
}, | |
{ | |
selector: 'function', | |
format: ['camelCase', 'PascalCase'], | |
leadingUnderscore: 'allow', | |
trailingUnderscore: 'allow', | |
}, | |
{ | |
selector: 'typeLike', | |
format: ['PascalCase'], | |
}, | |
], | |
'no-restricted-syntax': [ | |
'error', | |
{ | |
selector: 'ForInStatement', | |
message: '"for (... in ...)" is not allowed', | |
}, | |
{ | |
selector: 'ExportDefaultDeclaration', | |
message: '"export default ..." is not allowed', | |
}, | |
{ | |
selector: 'TSExportAssignment', | |
message: '"export = ..." is not allowed', | |
}, | |
{ | |
selector: 'ExportNamedDeclaration[specifiers.length>0]:not([source])', | |
message: '"export { ... }" is not allowed except when re-exporting', | |
}, | |
], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment