feat: typescript stylistic rules
Added rules from typescript-eslint/stylistic for typescript syntax. https://typescript-eslint.io/linting/configs/#stylistic
This commit is contained in:
@@ -9,6 +9,7 @@ const config = {
|
||||
'@typescript-eslint/ban-ts-comment': ['error', {
|
||||
'ts-ignore': 'allow-with-description',
|
||||
}],
|
||||
'@typescript-eslint/ban-tslint-comment': 'error',
|
||||
|
||||
'@typescript-eslint/no-require-imports': 'error',
|
||||
|
||||
@@ -25,6 +26,9 @@ const config = {
|
||||
|
||||
'no-use-before-define': 'off',
|
||||
'@typescript-eslint/no-use-before-define': 'error',
|
||||
|
||||
'no-empty-function': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'error',
|
||||
},
|
||||
};
|
||||
export default config;
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
/**
|
||||
* Typescript-specific configuration, mostly about it's type syntax
|
||||
* Typescript syntax-specific configuration
|
||||
* @type {import('../types').ESConfig}
|
||||
*/
|
||||
const config = {
|
||||
files: ['**/*.ts'],
|
||||
rules: {
|
||||
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
||||
'@typescript-eslint/array-type': 'error',
|
||||
'@typescript-eslint/class-literal-property': 'error',
|
||||
'@typescript-eslint/consistent-generic-constructors': 'error',
|
||||
'@typescript-eslint/consistent-indexed-object-style': 'error',
|
||||
'@typescript-eslint/consistent-type-assertions': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/consistent-type-exports': ['error'],
|
||||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: true }],
|
||||
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
||||
'@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }],
|
||||
'@typescript-eslint/type-annotation-spacing': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: true }],
|
||||
'@typescript-eslint/no-empty-interface': 'error',
|
||||
'@typescript-eslint/prefer-for-of': 'error',
|
||||
'@typescript-eslint/prefer-function-type': 'error',
|
||||
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
||||
},
|
||||
};
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user