Skip to content

Commit

Permalink
fix: eslint with plugin and config, include prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tabkram committed Nov 25, 2023
1 parent a3b449b commit a3aadfa
Show file tree
Hide file tree
Showing 13 changed files with 9,727 additions and 3,896 deletions.
42 changes: 42 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,42 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended'
],
plugins: ['@typescript-eslint', 'simple-import-sort', 'prettier'],
env: {
node: true,
jest: true
},
rules: {
// indent: ["error", 2],
'class-methods-use-this': 'off',
'max-len': ['error', { ignoreComments: true, code: 140, ignorePattern: '^import .*' }],
'no-await-in-loop': 'off',
'no-continue': 'off',
'no-extra-boolean-cast': 'off',
'no-constant-condition': ['error', { checkLoops: false }],
'no-param-reassign': ['error', { props: false }],
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
// Imports sort
'simple-import-sort/imports': 'error',
// Unused vars
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
// No shadow
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
// Means error
'prettier/prettier': 2,
'@typescript-eslint/no-explicit-any': 'error'
}
};
8 changes: 8 additions & 0 deletions .prettierrc
@@ -0,0 +1,8 @@
{
"parser": "typescript",
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"printWidth": 140,
"trailingComma": "none"
}

0 comments on commit a3aadfa

Please sign in to comment.