@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/node.json ADDED
@@ -0,0 +1,31 @@
1
+ // The Node preset: Cube's shared oxlint configuration plus what only applies to the
2
+ // backend packages. Frontend packages (@cubejs-client/*) extend the repo-root config or
3
+ // airbnb-react.json instead, so nothing here reaches them.
4
+ {
5
+ "$schema": "../../node_modules/oxlint/configuration_schema.json",
6
+ "extends": ["./.oxlintrc.json"],
7
+ "rules": {
8
+ // A control-flow block that opens right under an unrelated statement reads as part of
9
+ // it. Backend code is dense with them -- driver retry loops, connection teardown --
10
+ // so require the separating blank line. `for` covers for/for-in/for-of, `do` covers
11
+ // do/while; a plain `while` is left alone because its condition sits on the keyword
12
+ // line and already reads as its own statement.
13
+ "@stylistic/padding-line-between-statements": [
14
+ "warn",
15
+ { "blankLine": "always", "prev": "*", "next": ["try", "do", "for"] }
16
+ ]
17
+ },
18
+ "overrides": [
19
+ {
20
+ // A top-level `env` key is not inherited through `extends` -- oxlint treats it as
21
+ // per-config-file -- but an `overrides` entry's `env` is. Declaring the Node
22
+ // environment this way is what lets the backend packages extend this preset and get
23
+ // it, instead of each restating `{ "node": true, "es6": true }`.
24
+ "files": ["**"],
25
+ "env": {
26
+ "node": true,
27
+ "es6": true
28
+ }
29
+ }
30
+ ]
31
+ }
package/package.json CHANGED
@@ -1,35 +1,29 @@
1
1
  {
2
2
  "name": "@cubejs-backend/linter",
3
- "description": "Cube.js ESLint (virtual package) for linting code",
3
+ "description": "Cube shared oxlint configuration (virtual package) for linting code",
4
4
  "author": "Cube Dev, Inc.",
5
- "version": "1.7.36",
5
+ "version": "1.7.38",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/cube-js/cube.git",
9
- "directory": "packages/cubejs-mssql-driver"
9
+ "directory": "packages/cubejs-linter"
10
10
  },
11
11
  "engines": {
12
12
  "node": ">=20.0.0"
13
13
  },
14
- "main": "index.js",
15
- "peerDependencies": {
16
- "eslint": ">=8.57"
17
- },
18
14
  "dependencies": {
19
- "@stylistic/eslint-plugin-ts": "^3.1.0",
20
- "@typescript-eslint/eslint-plugin": "^8.46.0",
21
- "@typescript-eslint/parser": "^8.46.0",
22
- "eslint": "^8.57.1",
23
- "eslint-config-airbnb-base": "^14.2.1",
24
- "eslint-plugin-import": "^2.22.1",
25
- "eslint-plugin-node": "^10.0.0"
15
+ "@stylistic/eslint-plugin": "^5.10.0",
16
+ "oxlint": "^1.82.0"
26
17
  },
27
18
  "files": [
28
- "index.js"
19
+ ".oxlintrc.json",
20
+ "node.json",
21
+ "airbnb-base.json",
22
+ "airbnb-react.json"
29
23
  ],
30
24
  "license": "Apache-2.0",
31
25
  "publishConfig": {
32
26
  "access": "public"
33
27
  },
34
- "gitHead": "0e1c035e2b48a6b44cfd1f10d5c6e94b4bba76d6"
28
+ "gitHead": "9ea1fda5dade5b8a4256acd20bcf77318fe13a72"
35
29
  }
package/index.js DELETED
@@ -1,114 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: 'airbnb-base',
4
- env: {
5
- node: true,
6
- },
7
- plugins: ['import', '@typescript-eslint/eslint-plugin', '@stylistic/ts'],
8
- parser: '@typescript-eslint/parser',
9
- parserOptions: {
10
- sourceType: 'module',
11
- ecmaVersion: 2020,
12
- ecmaFeatures: {
13
- legacyDecorators: true,
14
- },
15
- },
16
- rules: {
17
- 'no-useless-constructor': 0,
18
- 'max-classes-per-file': 0,
19
- 'prefer-object-spread': 0,
20
- 'import/no-unresolved': 0,
21
- 'comma-dangle': 0,
22
- 'no-console': 0,
23
- 'arrow-parens': 0,
24
- 'import/prefer-default-export': 0,
25
- 'import/extensions': 0,
26
- quotes: ['warn', 'single'],
27
- 'no-prototype-builtins': 0,
28
- 'class-methods-use-this': 0,
29
- 'no-param-reassign': 0,
30
- 'no-mixed-operators': 0,
31
- 'no-else-return': 0,
32
- 'prefer-promise-reject-errors': 0,
33
- 'no-plusplus': 0,
34
- 'no-await-in-loop': 0,
35
- 'operator-linebreak': 0,
36
- // linter can't fix this itself and, in some cases, conflicts with `arrow-body-style`
37
- 'max-len': 0,
38
- 'no-trailing-spaces': ['warn', { skipBlankLines: true }],
39
- 'object-curly-newline': 0,
40
- // TypeScript Recommended
41
- 'no-array-constructor': 'off',
42
- '@typescript-eslint/no-array-constructor': 'error',
43
- 'no-empty-function': 'off',
44
- '@typescript-eslint/no-empty-function': 'error',
45
- 'no-extra-semi': 'off',
46
- '@stylistic/ts/no-extra-semi': 'error',
47
- 'no-underscore-dangle': 'off',
48
- 'no-unused-vars': 'off',
49
- '@typescript-eslint/no-unused-vars': [
50
- 'warn',
51
- {
52
- argsIgnorePattern: '^_.*',
53
- varsIgnorePattern: '^_.*',
54
- },
55
- ],
56
- // '@typescript-eslint/no-var-requires': 'error',
57
- '@typescript-eslint/prefer-as-const': 'error',
58
- '@typescript-eslint/prefer-namespace-keyword': 'error',
59
- '@typescript-eslint/triple-slash-reference': 'error',
60
- '@stylistic/ts/type-annotation-spacing': 'error',
61
- '@stylistic/ts/space-infix-ops': 'error',
62
- 'no-restricted-syntax': [
63
- 'error',
64
- {
65
- selector: 'ForInStatement',
66
- message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
67
- },
68
- {
69
- selector: 'LabeledStatement',
70
- message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
71
- },
72
- {
73
- selector: 'WithStatement',
74
- message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
75
- },
76
- ],
77
- },
78
- overrides: [
79
- {
80
- files: ['*.ts', '*.tsx'],
81
- rules: {
82
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/eslint-recommended.ts
83
- 'constructor-super': 'off', // ts(2335) & ts(2377)
84
- 'getter-return': 'off', // ts(2378)
85
- 'no-const-assign': 'off', // ts(2588)
86
- 'no-dupe-args': 'off', // ts(2300)
87
- 'no-dupe-class-members': 'off', // ts(2393) & ts(2300)
88
- 'no-dupe-keys': 'off', // ts(1117)
89
- 'no-func-assign': 'off', // ts(2539)
90
- 'no-import-assign': 'off', // ts(2539) & ts(2540)
91
- 'no-new-symbol': 'off', // ts(2588)
92
- 'no-obj-calls': 'off', // ts(2349)
93
- 'no-redeclare': 'off', // ts(2451)
94
- 'no-setter-return': 'off', // ts(2408)
95
- 'no-this-before-super': 'off', // ts(2376)
96
- 'no-undef': 'off', // ts(2304)
97
- 'no-unreachable': 'off', // ts(7027)
98
- 'no-unsafe-negation': 'off', // ts(2365) & ts(2360) & ts(2358)
99
- 'no-var': 'error', // ts transpiles let/const to var, so no need for vars any more
100
- 'prefer-const': 'error', // ts provides better types with const
101
- 'prefer-rest-params': 'error', // ts provides better types with rest args over arguments
102
- 'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply
103
- 'valid-typeof': 'off', // ts(2367)
104
- // TypeScript Additional
105
- '@typescript-eslint/explicit-member-accessibility': 'error',
106
- 'no-shadow': 'off',
107
- '@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
108
- 'no-duplicate-imports': 'off',
109
- semi: 'off',
110
- '@stylistic/ts/semi': 'error',
111
- },
112
- },
113
- ],
114
- };