Skip to content

Instantly share code, notes, and snippets.

@zzzz465
Last active August 27, 2023 07:25
Show Gist options
  • Save zzzz465/9c1a5d39431ab7dae46acb6dff95bd34 to your computer and use it in GitHub Desktop.
Save zzzz465/9c1a5d39431ab7dae46acb6dff95bd34 to your computer and use it in GitHub Desktop.
my eslint
/* eslint-disable @typescript-eslint/naming-convention */
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {},
plugins: ['@typescript-eslint', 'import', 'unused-imports'],
extends: [
'standard',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
// react related
// 'plugin:react/recommended',
// 'plugin:react/jsx-runtime',
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
}
},
rules: {
'@typescript-eslint/naming-convention': 'warn',
'@typescript-eslint/interface-name-prefix': 'off',
'no-case-declarations': 'error',
'no-underscore-dangle': 'off',
'no-restricted-syntax': ['off'],
'func-names': ['off'],
'import/prefer-default-export': 'off',
'comma-dangle': ['warn', 'only-multiline'],
'max-len': ['warn', { code: 100, ignorePattern: '^import\\.*' }],
'function-call-argument-newline': ['warn', 'consistent'],
'function-paren-newline': ['warn', 'consistent'],
'@typescript-eslint/member-delimiter-style': ['warn', {
multiline: {
delimiter: 'none'
}
}],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
'no-new': 'off',
'unused-imports/no-unused-imports': 'warn',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
'newlines-between': 'always'
},
],
'padding-line-between-statements': [
'warn',
{
// require blank line after end of import statements
blankLine: 'always',
prev: 'import',
next: [
'block-like',
'class',
'const',
'export',
'expression'
]
}
],
'import/no-unresolved': 'off',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment