|
| 1 | +{ |
| 2 | + "$schema": "./node_modules/oxlint/configuration_schema.json", |
| 3 | + "ignorePatterns": ["dist/**"], |
| 4 | + "categories": { |
| 5 | + "correctness": "error", |
| 6 | + "suspicious": "warn", |
| 7 | + "pedantic": "warn", |
| 8 | + "perf": "warn", |
| 9 | + "style": "warn", |
| 10 | + "restriction": "off" |
| 11 | + }, |
| 12 | + "plugins": ["import", "unicorn", "oxc", "promise", "jsdoc", "vitest", "node"], |
| 13 | + "rules": { |
| 14 | + "catch-error-name": ["warn", { "name": "err" }], |
| 15 | + "curly": ["off", "multi-line"], |
| 16 | + "group-exports": "off", |
| 17 | + "id-length": "off", |
| 18 | + "init-declarations": "off", |
| 19 | + "max-dependencies": "off", |
| 20 | + "max-lines": "off", |
| 21 | + "max-lines-per-function": "off", |
| 22 | + "max-params": ["warn", 4], |
| 23 | + "no-continue": "off", |
| 24 | + "no-console": "warn", |
| 25 | + "no-duplicate-imports": "off", |
| 26 | + "no-magic-numbers": "off", |
| 27 | + // "no-magic-numbers": ["warn", { "ignore": [-1, 0, 1, 2] }], |
| 28 | + "no-nested-ternary": "off", |
| 29 | + "no-null": "off", |
| 30 | + "no-ternary": "off", |
| 31 | + "no-warning-comments": "off", |
| 32 | + "sort-imports": "off", |
| 33 | + "sort-keys": "off", |
| 34 | + |
| 35 | + "import/exports-last": "off", |
| 36 | + // usually we just export vue components as default export without naming it |
| 37 | + "import/no-anonymous-default-export": "off", |
| 38 | + // a rule that shall not be enabled anyway |
| 39 | + "import/no-named-export": "off", |
| 40 | + "import/no-unassigned-import": ["error", { "allow": ["**/*.css", "**/*.scss"] }], |
| 41 | + // named export is preferred in our codebase |
| 42 | + "import/prefer-default-export": "off", |
| 43 | + "jsdoc/require-param": "off", |
| 44 | + "jsdoc/require-param-type": "off", |
| 45 | + "jsdoc/require-returns": "off", |
| 46 | + "jsdoc/require-returns-type": "off", |
| 47 | + "promise/always-return": "off", |
| 48 | + "promise/avoid-new": "off", |
| 49 | + "promise/prefer-await-to-then": "off", |
| 50 | + "unicorn/filename-case": "off", |
| 51 | + // toReversed can introduce memory overhead |
| 52 | + "unicorn/no-array-reverse": "off", |
| 53 | + // toSorted can introduce memory overhead |
| 54 | + "unicorn/no-array-sort": "off", |
| 55 | + "unicorn/no-nested-ternary": "off", |
| 56 | + // at is not supported by our target environments |
| 57 | + "unicorn/prefer-at": "off", |
| 58 | + "unicorn/prefer-global-this": "off", |
| 59 | + |
| 60 | + // seems conflicts with prettier |
| 61 | + "number-literal-case": "off", |
| 62 | + "numeric-separators-style": "off", |
| 63 | + |
| 64 | + // style rules |
| 65 | + "capitalized-comments": "off", |
| 66 | + "max-statements": ["warn", { "max": 30 }], |
| 67 | + "no-inline-comments": "off" |
| 68 | + }, |
| 69 | + "overrides": [ |
| 70 | + { |
| 71 | + "files": ["**/*.ts"], |
| 72 | + "plugins": ["typescript"], |
| 73 | + "rules": { |
| 74 | + // we make type casts only when necessary |
| 75 | + // "typescript/no-unsafe-type-assertion": "off", |
| 76 | + // skipping it for now, may enable it later |
| 77 | + // "typescript/switch-exhaustiveness-check": "off", |
| 78 | + // a lot of time we are just want to check existence |
| 79 | + // "typescript/strict-boolean-expressions": "off" |
| 80 | + } |
| 81 | + }, |
| 82 | + { |
| 83 | + "files": ["**/__tests__/**"], |
| 84 | + "plugins": ["vitest"] |
| 85 | + } |
| 86 | + ] |
| 87 | +} |
0 commit comments