@cubejs-backend/linter 1.7.36 → 1.7.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.oxlintrc.json +68 -0
- package/airbnb-base.json +703 -0
- package/airbnb-react.json +917 -0
- package/node.json +31 -0
- package/package.json +10 -16
- package/index.js +0 -114
package/.oxlintrc.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Cube's shared oxlint configuration, extended by the repo-root .oxlintrc.json.
|
|
2
|
+
//
|
|
3
|
+
// airbnb-base.json is the mechanical port of the airbnb-base + typescript-eslint rule set
|
|
4
|
+
// this package used to export as an ESLint config. Everything in this file is a deliberate
|
|
5
|
+
// departure from that port, with the reason stated.
|
|
6
|
+
//
|
|
7
|
+
// Note that oxlint's `extends` merges `rules`, `plugins`, `jsPlugins` and `overrides`, but
|
|
8
|
+
// NOT `env` or `ignorePatterns` -- those are per-config-file and have to be restated by
|
|
9
|
+
// whoever extends this. An `overrides` entry's own `env` does carry across, though.
|
|
10
|
+
{
|
|
11
|
+
"$schema": "../../node_modules/oxlint/configuration_schema.json",
|
|
12
|
+
"extends": ["./airbnb-base.json"],
|
|
13
|
+
"rules": {
|
|
14
|
+
// eslint-plugin-import never had a TypeScript resolver configured here
|
|
15
|
+
// (import/no-unresolved was off), so it could not resolve most imports and these five
|
|
16
|
+
// silently passed. oxlint resolves natively, which turns them on for the first time.
|
|
17
|
+
// Enabling them is separate work: as of this migration they report 173 dependency
|
|
18
|
+
// cycles, 366 hits on the `import R from 'ramda'; R.unnest()` idiom, and 2 genuine
|
|
19
|
+
// duplicate exports in client-core.
|
|
20
|
+
//
|
|
21
|
+
// import/named is off for a second reason: its verdict depends on build state, so it
|
|
22
|
+
// cannot gate anything. oxlint does not follow `export * from './time.js'` across a
|
|
23
|
+
// package boundary, so `import { GRANULARITIES } from '@cubejs-client/core'` reports
|
|
24
|
+
// "named import not found" once cubejs-client-core/dist exists and reports nothing
|
|
25
|
+
// before -- measured both ways on the same file. GRANULARITIES is genuinely exported
|
|
26
|
+
// (client-core src/time.ts:55, re-exported at src/index.ts:1026), so the warm-tree
|
|
27
|
+
// finding is a false positive; and CI is the cold case, since the lint job goes
|
|
28
|
+
// `yarn install` -> lint:npm -> lint:js with no build in between.
|
|
29
|
+
"import/no-cycle": "off",
|
|
30
|
+
"import/named": "off",
|
|
31
|
+
"import/no-named-as-default": "off",
|
|
32
|
+
"import/no-named-as-default-member": "off",
|
|
33
|
+
"import/export": "off",
|
|
34
|
+
// Two additions to what the ESLint config asked for, both about what `--fix` does to
|
|
35
|
+
// strings that contain quotes. `avoidEscape` is airbnb's default and was lost when this
|
|
36
|
+
// package downgraded `quotes` to a warning. `allowTemplateLiterals` matters more: the
|
|
37
|
+
// codebase uses backticks deliberately for SQL and JSON literals, and "fixing" those
|
|
38
|
+
// into single quotes turns e.g. the driver parameter-escaping tests into backslash
|
|
39
|
+
// soup -- which is precisely the code where quoting has to stay readable.
|
|
40
|
+
"@stylistic/quotes": [
|
|
41
|
+
"warn",
|
|
42
|
+
"single",
|
|
43
|
+
{ "avoidEscape": true, "allowTemplateLiterals": "always" }
|
|
44
|
+
],
|
|
45
|
+
// oxlint's built-in fallthrough comment pattern is stricter than ESLint's default and
|
|
46
|
+
// rejected the existing `// falls through, trick from 90x ...` comments.
|
|
47
|
+
"no-fallthrough": ["error", { "commentPattern": "falls?\\s?through" }]
|
|
48
|
+
},
|
|
49
|
+
"overrides": [
|
|
50
|
+
{
|
|
51
|
+
// oxlint honours neither `/* globals ... */` nor `/* eslint-env jest */`, which is how
|
|
52
|
+
// the .js test suites used to declare the jest globals.
|
|
53
|
+
"files": [
|
|
54
|
+
"**/test/**",
|
|
55
|
+
"**/tests/**",
|
|
56
|
+
"**/__mocks__/**",
|
|
57
|
+
"**/*.test.js",
|
|
58
|
+
"**/*.test.ts",
|
|
59
|
+
"**/*.test.tsx",
|
|
60
|
+
"**/*.spec.js",
|
|
61
|
+
"**/*.spec.ts",
|
|
62
|
+
"**/*.integration.js",
|
|
63
|
+
"**/*.integration.ts"
|
|
64
|
+
],
|
|
65
|
+
"env": { "jest": true }
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|