Skip to content

Commit

Permalink
🔧 update eslint config add new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem committed Sep 7, 2023
1 parent 0ef1f50 commit 5b4cab8
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parser: "@typescript-eslint/parser",
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "airbnb-typescript/base", "plugin:prettier/recommended"],
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
}
}
ecmaVersion: 2020,
sourceType: "module",
project: './tsconfig.eslint.json',
},
env: {
node: true,
es6: true,
},
plugins: ["@typescript-eslint", "prettier", "security", "import"],
rules: {
"prettier/prettier": "error",
"no-var": "error",
"prefer-const": "error",
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"security/detect-object-injection": "warn",
"security/detect-unsafe-regex": "error",
},
settings: {},
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
},
},
],
};

0 comments on commit 5b4cab8

Please sign in to comment.