Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(typescript): add support for @typescript-eslint/eslint-plugin 3.x #125

Merged
merged 1 commit into from Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion base.js
Expand Up @@ -22,6 +22,6 @@ module.exports = {
],
plugins: ['eslint-comments', 'import', 'prettier'],
settings: {
'import/extensions': ['.js'],
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
};
3 changes: 3 additions & 0 deletions rules/base.js
Expand Up @@ -277,6 +277,9 @@ module.exports = {
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],

Expand Down
33 changes: 23 additions & 10 deletions rules/typescript.js
Expand Up @@ -5,9 +5,28 @@ module.exports = {
'@typescript-eslint/adjacent-overload-signatures': ['error'],
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/ban-types': ['error'],
'@typescript-eslint/ban-ts-ignore': ['off'],
'@typescript-eslint/camelcase': ['error'],
'@typescript-eslint/class-name-casing': ['error'],
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
{
selector: 'typeParameter',
format: ['PascalCase'],
prefix: ['T', 'K'],
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
francoischalifour marked this conversation as resolved.
Show resolved Hide resolved
match: false,
},
},
],
'@typescript-eslint/consistent-type-assertions': [
'error',
{
Expand All @@ -17,14 +36,8 @@ module.exports = {
],
'@typescript-eslint/explicit-function-return-type': ['off'],
'@typescript-eslint/explicit-member-accessibility': ['error'],
'@typescript-eslint/generic-type-naming': [
'error',
'^(T|K)[A-Z][a-zA-Z]+$',
],
'@typescript-eslint/indent': ['off'],
'@typescript-eslint/interface-name-prefix': ['error', 'never'],
'@typescript-eslint/member-delimiter-style': ['off'],
'@typescript-eslint/member-naming': ['off'],
'@typescript-eslint/member-ordering': [
'error',
{
Expand Down Expand Up @@ -59,7 +72,7 @@ module.exports = {
'@typescript-eslint/no-var-requires': ['off'],
'@typescript-eslint/prefer-for-of': ['off'],
'@typescript-eslint/prefer-function-type': ['error'],
'@typescript-eslint/prefer-interface': ['off'],
'@typescript-eslint/consistent-type-definitions': ['off'],
'@typescript-eslint/prefer-namespace-keyword': ['error'],
'@typescript-eslint/promise-function-async': ['off'],
'@typescript-eslint/restrict-plus-operands': ['off'],
Expand Down