Skip to content

Commit

Permalink
feat(typescript): add support for @typescript-eslint/eslint-plugin 3.x (
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Jun 1, 2020
1 parent ae433de commit 60d2ad1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
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]',
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

0 comments on commit 60d2ad1

Please sign in to comment.