|
| 1 | +module.export = [ |
| 2 | + { |
| 3 | + root: true, |
| 4 | + env: { |
| 5 | + browser: true, |
| 6 | + es6: true, |
| 7 | + jest: true, |
| 8 | + }, |
| 9 | + extends: [ |
| 10 | + "eslint:recommended", |
| 11 | + "standard", |
| 12 | + "standard-jsx", |
| 13 | + "standard-react", |
| 14 | + "plugin:@typescript-eslint/recommended", |
| 15 | + "prettier", |
| 16 | + ], |
| 17 | + parser: "@typescript-eslint/parser", |
| 18 | + parserOptions: { |
| 19 | + ecmaVersion: 7, |
| 20 | + ecmaFeatures: { |
| 21 | + jsx: true, |
| 22 | + }, |
| 23 | + sourceType: "module", |
| 24 | + }, |
| 25 | + plugins: ["agama-i18n", "flowtype", "i18next", "react", "react-hooks", "@typescript-eslint"], |
| 26 | + rules: { |
| 27 | + "agama-i18n/string-literals": "error", |
| 28 | + "i18next/no-literal-string": "error", |
| 29 | + "no-var": "error", |
| 30 | + "no-multi-str": "off", |
| 31 | + "no-use-before-define": "off", |
| 32 | + "@typescript-eslint/no-unused-vars": "off", |
| 33 | + "@typescript-eslint/no-use-before-define": "warn", |
| 34 | + "@typescript-eslint/ban-ts-comment": "off", |
| 35 | + "lines-between-class-members": [ |
| 36 | + "error", |
| 37 | + "always", |
| 38 | + { |
| 39 | + exceptAfterSingleLine: true, |
| 40 | + }, |
| 41 | + ], |
| 42 | + "prefer-promise-reject-errors": [ |
| 43 | + "error", |
| 44 | + { |
| 45 | + allowEmptyReject: true, |
| 46 | + }, |
| 47 | + ], |
| 48 | + "react-hooks/rules-of-hooks": "error", |
| 49 | + "react-hooks/exhaustive-deps": "error", |
| 50 | + camelcase: "off", |
| 51 | + "comma-dangle": "off", |
| 52 | + curly: "off", |
| 53 | + "jsx-quotes": "off", |
| 54 | + "key-spacing": "off", |
| 55 | + "no-console": "off", |
| 56 | + quotes: "off", |
| 57 | + "react/jsx-curly-spacing": "off", |
| 58 | + "react/jsx-indent-props": "off", |
| 59 | + "react/prop-types": "off", |
| 60 | + "space-before-function-paren": "off", |
| 61 | + "n/no-callback-literal": "off", |
| 62 | + }, |
| 63 | + overrides: [ |
| 64 | + { |
| 65 | + // do not check translations in the testing or development files |
| 66 | + files: ["*.test.*", "test-utils.js"], |
| 67 | + rules: { |
| 68 | + "i18next/no-literal-string": "off", |
| 69 | + }, |
| 70 | + }, |
| 71 | + { |
| 72 | + // do not check translation arguments in the test, it checks some internals by passing variables |
| 73 | + files: ["i18n.test.js"], |
| 74 | + rules: { |
| 75 | + "agama-i18n/string-literals": "off", |
| 76 | + }, |
| 77 | + }, |
| 78 | + ], |
| 79 | + globals: { |
| 80 | + require: false, |
| 81 | + module: false, |
| 82 | + }, |
| 83 | + ignores: ["node_modules/*", "src/lib/*", "src/**/test-data/*"], |
| 84 | + }, |
| 85 | +]; |
0 commit comments