Last active
March 28, 2021 19:54
-
-
Save GarryOne/e1ea24b6838c6c7b0c65ec39e5cdac74 to your computer and use it in GitHub Desktop.
ESLint/TSLint configuration with typescript, prettier. Works with auto-fix for removing unused imports, separating imports...
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 = { | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
project: 'tsconfig.json', | |
sourceType: 'module', | |
}, | |
plugins: ['@typescript-eslint/eslint-plugin', 'unused-imports', 'import'], | |
extends: [ | |
'plugin:@typescript-eslint/recommended', | |
'plugin:prettier/recommended', | |
], | |
root: true, | |
env: { | |
node: true, | |
jest: true, | |
}, | |
ignorePatterns: ['.eslintrc.js'], | |
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-unused-vars": "off", | |
"unused-imports/no-unused-imports": "error", | |
"unused-imports/no-unused-vars": [ | |
"warn", | |
{ | |
"vars": "all", | |
"varsIgnorePattern": "^_", | |
"args": "after-used", | |
"argsIgnorePattern": "^_", | |
} | |
], | |
"import/order": [ | |
"warn", | |
{ | |
"newlines-between": "always" | |
} | |
], | |
"padding-line-between-statements": [ | |
"error", | |
{ blankLine: "always", prev: ['var', 'const', 'function', 'class'], next: ['if', 'while', 'function'] } | |
] | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment