1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/.eslintrc
Gastón Fournier ea9bf7f447
chore: add linter rules for regexp (#3500)
## About the changes
Add linter rules for regexp security vulnerabilities

Commit 1c5d54c76e [fails due to
regexp/no-super-linear-backtracking](https://github.com/Unleash/unleash/actions/runs/4668430535/jobs/8265506170#step:5:37)
as reported here:
https://github.com/Unleash/unleash/security/code-scanning/1


[0127d1a](0127d1a746)
fixes the issues and warnings by running `yarn lint --fix`
2023-04-17 07:11:22 +00:00

60 lines
1.9 KiB
Plaintext

{
"env": {
"node": true,
"jest": true
},
"extends": ["airbnb-typescript/base", "plugin:prettier/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2019,
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "prettier", "import", "no-only-tests", "regexp"],
"root": true,
"rules": {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/naming-convention": 0,
"@typescript-eslint/space-before-function-paren": 0,
"import/prefer-default-export": 0,
"import/no-unresolved": 0,
"class-methods-use-this": [0],
"prettier/prettier": ["error"],
"func-names": "off",
"strict": [0, "global"],
"no-underscore-dangle": "off",
"no-plusplus": "off",
"no-param-reassign": "error",
"no-return-await": "error",
"max-nested-callbacks": "off",
"no-only-tests/no-only-tests": "error",
"new-cap": [
"error",
{
"capIsNewExceptions": ["Router", "Mitm"]
}
],
"regexp/no-super-linear-backtracking": "error",
"regexp/strict": "warn",
"regexp/no-useless-escape": "warn",
"prefer-regex-literals": "warn"
},
"overrides": [
{
// enable the rule specifically for TypeScript files
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"@typescript-eslint/naming-convention": ["error"],
"@typescript-eslint/space-before-function-paren": ["error"]
}
},
{
"files": ["src/test/e2e/helpers/test-helper.ts"],
"rules": {
"import/no-extraneous-dependencies": "off"
}
}
],
"ignorePatterns": ["**/docs/api/oas/", "examples/**", "scripts/**"]
}