@4mbl/lint 1.0.0-beta.1 → 1.0.0-beta.3
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/CHANGELOG.md +23 -1
- package/README.md +80 -26
- package/bin/cli.js +28 -9
- package/dist/base.d.ts +243 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +129 -0
- package/dist/base.js.map +1 -0
- package/dist/next.d.ts +18 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +64 -0
- package/dist/next.js.map +1 -0
- package/dist/node.d.ts +253 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +15 -0
- package/dist/node.js.map +1 -0
- package/dist/react.d.ts +365 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +72 -0
- package/dist/react.js.map +1 -0
- package/package.json +9 -6
- package/src/base.ts +0 -134
- package/src/next.ts +0 -81
- package/src/node.ts +0 -15
- package/src/react.ts +0 -76
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
# @4mbl/lint
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- dd91a0d: Allow direct preset usage with default exports
|
|
8
|
+
- dd91a0d: Add `--preset` argument to use any preset directly from the CLI
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 51c5a6a: Resolve uiPath from cwd in next preset
|
|
13
|
+
|
|
14
|
+
## 1.0.0-beta.2
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- ba4500a: Use named exports for config templates
|
|
19
|
+
- ba4500a: Re-export oxlint defineConfig
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 2b77e08: Transpile configs to support usage from node_modules
|
|
24
|
+
|
|
3
25
|
## 1.0.0-beta.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
6
28
|
|
|
7
|
-
- 2c338b1:
|
|
29
|
+
- 2c338b1: Re-export `OxlintConfig` to make config portable
|
|
8
30
|
|
|
9
31
|
## 1.0.0-beta.0
|
|
10
32
|
|
package/README.md
CHANGED
|
@@ -2,18 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
> Linting configuration for various environments.
|
|
4
4
|
|
|
5
|
+
- [Installation](#installation)
|
|
5
6
|
- [Usage](#usage)
|
|
6
|
-
- [
|
|
7
|
-
|
|
8
|
-
- [
|
|
7
|
+
- [Using `lint` CLI](#using-lint-cli)
|
|
8
|
+
- [Setting up the `lint` CLI](#setting-up-the-lint-cli)
|
|
9
|
+
- [Choosing presets](#choosing-presets)
|
|
10
|
+
- [Beyond presets](#beyond-presets)
|
|
11
|
+
- [CLI default arguments](#cli-default-arguments)
|
|
12
|
+
- [Using `oxlint` directly](#using-oxlint-directly)
|
|
13
|
+
- [Oxlint CLI](#oxlint-cli)
|
|
14
|
+
- [Configuring oxlint](#configuring-oxlint)
|
|
15
|
+
- [Available presets](#available-presets)
|
|
9
16
|
- [Versioning](#versioning)
|
|
10
17
|
|
|
11
18
|
---
|
|
12
19
|
|
|
13
20
|
> [!NOTE]
|
|
14
|
-
> This package currently uses [oxlint](https://www.npmjs.com/package/oxlint) as the underlying linting tool.
|
|
21
|
+
> This package currently uses [oxlint](https://www.npmjs.com/package/oxlint) as the underlying linting tool. This may change in a future major release.
|
|
15
22
|
|
|
16
|
-
##
|
|
23
|
+
## Installation
|
|
17
24
|
|
|
18
25
|
Install the [`@4mbl/lint`](https://www.npmjs.com/package/@4mbl/lint) package.
|
|
19
26
|
|
|
@@ -21,32 +28,64 @@ Install the [`@4mbl/lint`](https://www.npmjs.com/package/@4mbl/lint) package.
|
|
|
21
28
|
npm install -D @4mbl/lint
|
|
22
29
|
```
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
## Usage
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
import defineConfig from '@4mbl/lint/next'; // <-- change `next` to the desired template
|
|
33
|
+
This package supports two ways of running the linting tool.
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
```
|
|
35
|
+
### Using `lint` CLI
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
Using the provided `lint` CLI is the recommended approach, as it abstracts away the underlying linting tool and allows it to be changed in the future with minimal impact on consumers.
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
While we aim to keep the CLI stable across tooling changes, some breaking changes may be unavoidable if the underlying tool changes.
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
#### Setting up the `lint` CLI
|
|
42
|
+
|
|
43
|
+
To use the provided CLI, simply call `lint` in your scripts.
|
|
37
44
|
|
|
38
45
|
```shell
|
|
39
46
|
npm pkg set scripts.lint="lint"
|
|
40
47
|
```
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
#### Choosing presets
|
|
50
|
+
|
|
51
|
+
The CLI uses the environment-agnostic `base` preset by default. To use a different preset, pass the `--preset` argument with the preset name.
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
npm pkg set scripts.lint="lint --preset node"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
_See the [available presets](#available-presets) section for a list of available presets._
|
|
58
|
+
|
|
59
|
+
#### Beyond presets
|
|
60
|
+
|
|
61
|
+
In some cases, the provided presets may not be sufficient for your use case. You can create an `oxlint.config.ts` file and pass it to the oxlint CLI directly.
|
|
62
|
+
|
|
63
|
+
```shell
|
|
64
|
+
npm pkg set scripts.lint="lint -- --config oxlint.config.ts"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
You can use the provided presets as a base for your custom configuration, as shown in the [Configuring oxlint](#configuring-oxlint) section.
|
|
68
|
+
|
|
69
|
+
#### CLI default arguments
|
|
70
|
+
|
|
71
|
+
By default, the CLI targets the `src` directory and uses the following oxlint arguments:
|
|
43
72
|
|
|
44
73
|
- `--max-warnings=0`
|
|
45
74
|
- `--report-unused-disable-directives`
|
|
46
75
|
|
|
47
|
-
|
|
76
|
+
You can override these arguments or pass additional arguments to the underlying oxlint tool.
|
|
77
|
+
|
|
78
|
+
```shell
|
|
79
|
+
npm pkg set scripts.lint="lint -- --max-warnings=10 --fix"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Using `oxlint` directly
|
|
83
|
+
|
|
84
|
+
For full control over the linting setup, you can use oxlint directly.
|
|
85
|
+
|
|
86
|
+
#### Oxlint CLI
|
|
48
87
|
|
|
49
|
-
|
|
88
|
+
Set the `lint` script in your `package.json` to use the `oxlint` binary.
|
|
50
89
|
|
|
51
90
|
```shell
|
|
52
91
|
npm pkg set scripts.lint="oxlint src"
|
|
@@ -54,25 +93,40 @@ npm pkg set scripts.lint="oxlint src"
|
|
|
54
93
|
|
|
55
94
|
You may need to explicitly allow the underlying linting packages to be used by your scripts.
|
|
56
95
|
|
|
57
|
-
For example, when using pnpm,
|
|
96
|
+
For example, when using pnpm, set `publicHoistPattern` in your `pnpm-workspace.yaml`.
|
|
97
|
+
|
|
98
|
+
#### Configuring oxlint
|
|
99
|
+
|
|
100
|
+
Create an `oxlint.config.ts` file in your package with the desired preset.
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
import nodeConfig from '@4mbl/lint/node';
|
|
104
|
+
|
|
105
|
+
export default nodeConfig();
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Some presets may accept additional options. For example, the `next` preset accepts a `uiPath` option.
|
|
109
|
+
|
|
110
|
+
_See the [available presets](#available-presets) section for a list of available presets._
|
|
58
111
|
|
|
59
112
|
```yaml
|
|
60
113
|
publicHoistPattern:
|
|
61
114
|
- oxlint
|
|
62
115
|
```
|
|
63
116
|
|
|
64
|
-
## Available
|
|
117
|
+
## Available presets
|
|
65
118
|
|
|
66
|
-
|
|
119
|
+
The following presets are currently available:
|
|
67
120
|
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
70
|
-
- **
|
|
121
|
+
- **Base** – Environment-agnostic linting rules.
|
|
122
|
+
- **Next** – Additional linting rules for Next.js.
|
|
123
|
+
- **Node** – Additional linting rules for Node.js.
|
|
124
|
+
- **React** – Additional linting rules for React.
|
|
71
125
|
|
|
72
126
|
## Versioning
|
|
73
127
|
|
|
74
|
-
The package follows the
|
|
128
|
+
The package follows the versioning scheme `X.Y.Z`:
|
|
75
129
|
|
|
76
|
-
- `X`
|
|
77
|
-
- `Y`
|
|
78
|
-
- `Z`
|
|
130
|
+
- `X` – Reserved for linting provider changes, as these may introduce broader compatibility issues.
|
|
131
|
+
- `Y` – New linting rules. Rules are initially introduced as warnings and may be promoted to errors in a subsequent minor release.
|
|
132
|
+
- `Z` – Fixes for issues that made the previous release unusable.
|
package/bin/cli.js
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
4
6
|
|
|
5
|
-
const
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
6
9
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
+
const rawArgs = process.argv.slice(2);
|
|
11
|
+
|
|
12
|
+
const separatorIndex = rawArgs.indexOf('--');
|
|
13
|
+
|
|
14
|
+
const wrapperArgs =
|
|
15
|
+
separatorIndex === -1 ? rawArgs : rawArgs.slice(0, separatorIndex);
|
|
16
|
+
const toolArgs = separatorIndex === -1 ? [] : rawArgs.slice(separatorIndex + 1);
|
|
17
|
+
|
|
18
|
+
const presetArgIndex = wrapperArgs.findIndex((a) => a === '--preset');
|
|
19
|
+
const presetName =
|
|
20
|
+
presetArgIndex !== -1 ? wrapperArgs[presetArgIndex + 1] : 'base';
|
|
21
|
+
|
|
22
|
+
const configPath = path.resolve(__dirname, `../dist/${presetName}.js`);
|
|
23
|
+
|
|
24
|
+
const hasPath = toolArgs.some((a) => !a.startsWith('-'));
|
|
25
|
+
const hasMaxWarn = toolArgs.some((a) => a.startsWith('--max-warnings'));
|
|
26
|
+
const hasReportUnused = toolArgs.some((a) =>
|
|
10
27
|
a.startsWith('--report-unused-disable-directives'),
|
|
11
28
|
);
|
|
12
29
|
|
|
13
30
|
const finalArgs = [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
'--config',
|
|
32
|
+
configPath,
|
|
33
|
+
hasPath ? undefined : 'src',
|
|
34
|
+
hasMaxWarn ? undefined : '--max-warnings=0',
|
|
35
|
+
hasReportUnused ? undefined : '--report-unused-disable-directives',
|
|
36
|
+
...toolArgs,
|
|
37
|
+
].filter((a) => a !== undefined);
|
|
19
38
|
|
|
20
39
|
const result = spawnSync('oxlint', finalArgs, {
|
|
21
40
|
stdio: 'inherit',
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { defineConfig, type OxlintConfig } from 'oxlint';
|
|
2
|
+
type BaseOptions = {};
|
|
3
|
+
declare function baseConfig(_options?: Partial<BaseOptions>): {
|
|
4
|
+
plugins: ("unicorn" | "typescript")[];
|
|
5
|
+
jsPlugins: never[];
|
|
6
|
+
categories: {
|
|
7
|
+
correctness: "off";
|
|
8
|
+
};
|
|
9
|
+
env: {
|
|
10
|
+
builtin: true;
|
|
11
|
+
};
|
|
12
|
+
options: {
|
|
13
|
+
typeAware: true;
|
|
14
|
+
};
|
|
15
|
+
rules: {
|
|
16
|
+
'constructor-super': "error";
|
|
17
|
+
'for-direction': "error";
|
|
18
|
+
'getter-return': "error";
|
|
19
|
+
'no-async-promise-executor': "error";
|
|
20
|
+
'no-case-declarations': "error";
|
|
21
|
+
'no-class-assign': "error";
|
|
22
|
+
'no-compare-neg-zero': "error";
|
|
23
|
+
'no-cond-assign': "error";
|
|
24
|
+
'no-const-assign': "error";
|
|
25
|
+
'no-constant-binary-expression': "error";
|
|
26
|
+
'no-constant-condition': "error";
|
|
27
|
+
'no-control-regex': "error";
|
|
28
|
+
'no-debugger': "error";
|
|
29
|
+
'no-delete-var': "error";
|
|
30
|
+
'no-dupe-class-members': "error";
|
|
31
|
+
'no-dupe-else-if': "error";
|
|
32
|
+
'no-dupe-keys': "error";
|
|
33
|
+
'no-duplicate-case': "error";
|
|
34
|
+
'no-empty': "error";
|
|
35
|
+
'no-empty-character-class': "error";
|
|
36
|
+
'no-empty-pattern': "error";
|
|
37
|
+
'no-empty-static-block': "error";
|
|
38
|
+
'no-ex-assign': "error";
|
|
39
|
+
'no-extra-boolean-cast': "error";
|
|
40
|
+
'no-fallthrough': "error";
|
|
41
|
+
'no-func-assign': "error";
|
|
42
|
+
'no-global-assign': "error";
|
|
43
|
+
'no-import-assign': "error";
|
|
44
|
+
'no-invalid-regexp': "error";
|
|
45
|
+
'no-irregular-whitespace': "error";
|
|
46
|
+
'no-loss-of-precision': "error";
|
|
47
|
+
'no-misleading-character-class': "error";
|
|
48
|
+
'no-new-native-nonconstructor': "error";
|
|
49
|
+
'no-nonoctal-decimal-escape': "error";
|
|
50
|
+
'no-obj-calls': "error";
|
|
51
|
+
'no-prototype-builtins': "error";
|
|
52
|
+
'no-redeclare': "error";
|
|
53
|
+
'no-regex-spaces': "error";
|
|
54
|
+
'no-self-assign': "error";
|
|
55
|
+
'no-setter-return': "error";
|
|
56
|
+
'no-shadow-restricted-names': "error";
|
|
57
|
+
'no-sparse-arrays': "error";
|
|
58
|
+
'no-this-before-super': "error";
|
|
59
|
+
'no-undef': "error";
|
|
60
|
+
'no-unexpected-multiline': "error";
|
|
61
|
+
'no-unreachable': "error";
|
|
62
|
+
'no-unsafe-finally': "error";
|
|
63
|
+
'no-unsafe-negation': "error";
|
|
64
|
+
'no-unsafe-optional-chaining': "error";
|
|
65
|
+
'no-unused-labels': "error";
|
|
66
|
+
'no-unused-private-class-members': "error";
|
|
67
|
+
'no-unused-vars': "warn";
|
|
68
|
+
'no-useless-backreference': "error";
|
|
69
|
+
'no-useless-catch': "error";
|
|
70
|
+
'no-useless-escape': "error";
|
|
71
|
+
'no-with': "error";
|
|
72
|
+
'require-yield': "error";
|
|
73
|
+
'use-isnan': "error";
|
|
74
|
+
'valid-typeof': "error";
|
|
75
|
+
'@typescript-eslint/ban-ts-comment': "error";
|
|
76
|
+
'no-array-constructor': "error";
|
|
77
|
+
'@typescript-eslint/no-duplicate-enum-values': "error";
|
|
78
|
+
'@typescript-eslint/no-empty-object-type': "error";
|
|
79
|
+
'@typescript-eslint/no-explicit-any': "error";
|
|
80
|
+
'@typescript-eslint/no-extra-non-null-assertion': "error";
|
|
81
|
+
'@typescript-eslint/no-misused-new': "error";
|
|
82
|
+
'@typescript-eslint/no-namespace': "error";
|
|
83
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': "error";
|
|
84
|
+
'@typescript-eslint/no-require-imports': "error";
|
|
85
|
+
'@typescript-eslint/no-this-alias': "error";
|
|
86
|
+
'@typescript-eslint/no-unnecessary-type-constraint': "error";
|
|
87
|
+
'@typescript-eslint/no-unsafe-declaration-merging': "error";
|
|
88
|
+
'@typescript-eslint/no-unsafe-function-type': "error";
|
|
89
|
+
'no-unused-expressions': "warn";
|
|
90
|
+
'@typescript-eslint/no-wrapper-object-types': "error";
|
|
91
|
+
'@typescript-eslint/prefer-as-const': "error";
|
|
92
|
+
'@typescript-eslint/prefer-namespace-keyword': "error";
|
|
93
|
+
'@typescript-eslint/triple-slash-reference': "error";
|
|
94
|
+
};
|
|
95
|
+
overrides: {
|
|
96
|
+
files: string[];
|
|
97
|
+
rules: {
|
|
98
|
+
'constructor-super': "off";
|
|
99
|
+
'getter-return': "off";
|
|
100
|
+
'no-class-assign': "off";
|
|
101
|
+
'no-const-assign': "off";
|
|
102
|
+
'no-dupe-class-members': "off";
|
|
103
|
+
'no-dupe-keys': "off";
|
|
104
|
+
'no-func-assign': "off";
|
|
105
|
+
'no-import-assign': "off";
|
|
106
|
+
'no-new-native-nonconstructor': "off";
|
|
107
|
+
'no-obj-calls': "off";
|
|
108
|
+
'no-redeclare': "off";
|
|
109
|
+
'no-setter-return': "off";
|
|
110
|
+
'no-this-before-super': "off";
|
|
111
|
+
'no-undef': "off";
|
|
112
|
+
'no-unreachable': "off";
|
|
113
|
+
'no-unsafe-negation': "off";
|
|
114
|
+
'no-var': "error";
|
|
115
|
+
'no-with': "off";
|
|
116
|
+
'prefer-const': "error";
|
|
117
|
+
'prefer-rest-params': "error";
|
|
118
|
+
'prefer-spread': "error";
|
|
119
|
+
};
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
export { type OxlintConfig, defineConfig, baseConfig };
|
|
123
|
+
declare const _default: {
|
|
124
|
+
plugins: ("unicorn" | "typescript")[];
|
|
125
|
+
jsPlugins: never[];
|
|
126
|
+
categories: {
|
|
127
|
+
correctness: "off";
|
|
128
|
+
};
|
|
129
|
+
env: {
|
|
130
|
+
builtin: true;
|
|
131
|
+
};
|
|
132
|
+
options: {
|
|
133
|
+
typeAware: true;
|
|
134
|
+
};
|
|
135
|
+
rules: {
|
|
136
|
+
'constructor-super': "error";
|
|
137
|
+
'for-direction': "error";
|
|
138
|
+
'getter-return': "error";
|
|
139
|
+
'no-async-promise-executor': "error";
|
|
140
|
+
'no-case-declarations': "error";
|
|
141
|
+
'no-class-assign': "error";
|
|
142
|
+
'no-compare-neg-zero': "error";
|
|
143
|
+
'no-cond-assign': "error";
|
|
144
|
+
'no-const-assign': "error";
|
|
145
|
+
'no-constant-binary-expression': "error";
|
|
146
|
+
'no-constant-condition': "error";
|
|
147
|
+
'no-control-regex': "error";
|
|
148
|
+
'no-debugger': "error";
|
|
149
|
+
'no-delete-var': "error";
|
|
150
|
+
'no-dupe-class-members': "error";
|
|
151
|
+
'no-dupe-else-if': "error";
|
|
152
|
+
'no-dupe-keys': "error";
|
|
153
|
+
'no-duplicate-case': "error";
|
|
154
|
+
'no-empty': "error";
|
|
155
|
+
'no-empty-character-class': "error";
|
|
156
|
+
'no-empty-pattern': "error";
|
|
157
|
+
'no-empty-static-block': "error";
|
|
158
|
+
'no-ex-assign': "error";
|
|
159
|
+
'no-extra-boolean-cast': "error";
|
|
160
|
+
'no-fallthrough': "error";
|
|
161
|
+
'no-func-assign': "error";
|
|
162
|
+
'no-global-assign': "error";
|
|
163
|
+
'no-import-assign': "error";
|
|
164
|
+
'no-invalid-regexp': "error";
|
|
165
|
+
'no-irregular-whitespace': "error";
|
|
166
|
+
'no-loss-of-precision': "error";
|
|
167
|
+
'no-misleading-character-class': "error";
|
|
168
|
+
'no-new-native-nonconstructor': "error";
|
|
169
|
+
'no-nonoctal-decimal-escape': "error";
|
|
170
|
+
'no-obj-calls': "error";
|
|
171
|
+
'no-prototype-builtins': "error";
|
|
172
|
+
'no-redeclare': "error";
|
|
173
|
+
'no-regex-spaces': "error";
|
|
174
|
+
'no-self-assign': "error";
|
|
175
|
+
'no-setter-return': "error";
|
|
176
|
+
'no-shadow-restricted-names': "error";
|
|
177
|
+
'no-sparse-arrays': "error";
|
|
178
|
+
'no-this-before-super': "error";
|
|
179
|
+
'no-undef': "error";
|
|
180
|
+
'no-unexpected-multiline': "error";
|
|
181
|
+
'no-unreachable': "error";
|
|
182
|
+
'no-unsafe-finally': "error";
|
|
183
|
+
'no-unsafe-negation': "error";
|
|
184
|
+
'no-unsafe-optional-chaining': "error";
|
|
185
|
+
'no-unused-labels': "error";
|
|
186
|
+
'no-unused-private-class-members': "error";
|
|
187
|
+
'no-unused-vars': "warn";
|
|
188
|
+
'no-useless-backreference': "error";
|
|
189
|
+
'no-useless-catch': "error";
|
|
190
|
+
'no-useless-escape': "error";
|
|
191
|
+
'no-with': "error";
|
|
192
|
+
'require-yield': "error";
|
|
193
|
+
'use-isnan': "error";
|
|
194
|
+
'valid-typeof': "error";
|
|
195
|
+
'@typescript-eslint/ban-ts-comment': "error";
|
|
196
|
+
'no-array-constructor': "error";
|
|
197
|
+
'@typescript-eslint/no-duplicate-enum-values': "error";
|
|
198
|
+
'@typescript-eslint/no-empty-object-type': "error";
|
|
199
|
+
'@typescript-eslint/no-explicit-any': "error";
|
|
200
|
+
'@typescript-eslint/no-extra-non-null-assertion': "error";
|
|
201
|
+
'@typescript-eslint/no-misused-new': "error";
|
|
202
|
+
'@typescript-eslint/no-namespace': "error";
|
|
203
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': "error";
|
|
204
|
+
'@typescript-eslint/no-require-imports': "error";
|
|
205
|
+
'@typescript-eslint/no-this-alias': "error";
|
|
206
|
+
'@typescript-eslint/no-unnecessary-type-constraint': "error";
|
|
207
|
+
'@typescript-eslint/no-unsafe-declaration-merging': "error";
|
|
208
|
+
'@typescript-eslint/no-unsafe-function-type': "error";
|
|
209
|
+
'no-unused-expressions': "warn";
|
|
210
|
+
'@typescript-eslint/no-wrapper-object-types': "error";
|
|
211
|
+
'@typescript-eslint/prefer-as-const': "error";
|
|
212
|
+
'@typescript-eslint/prefer-namespace-keyword': "error";
|
|
213
|
+
'@typescript-eslint/triple-slash-reference': "error";
|
|
214
|
+
};
|
|
215
|
+
overrides: {
|
|
216
|
+
files: string[];
|
|
217
|
+
rules: {
|
|
218
|
+
'constructor-super': "off";
|
|
219
|
+
'getter-return': "off";
|
|
220
|
+
'no-class-assign': "off";
|
|
221
|
+
'no-const-assign': "off";
|
|
222
|
+
'no-dupe-class-members': "off";
|
|
223
|
+
'no-dupe-keys': "off";
|
|
224
|
+
'no-func-assign': "off";
|
|
225
|
+
'no-import-assign': "off";
|
|
226
|
+
'no-new-native-nonconstructor': "off";
|
|
227
|
+
'no-obj-calls': "off";
|
|
228
|
+
'no-redeclare': "off";
|
|
229
|
+
'no-setter-return': "off";
|
|
230
|
+
'no-this-before-super': "off";
|
|
231
|
+
'no-undef': "off";
|
|
232
|
+
'no-unreachable': "off";
|
|
233
|
+
'no-unsafe-negation': "off";
|
|
234
|
+
'no-var': "error";
|
|
235
|
+
'no-with': "off";
|
|
236
|
+
'prefer-const': "error";
|
|
237
|
+
'prefer-rest-params': "error";
|
|
238
|
+
'prefer-spread': "error";
|
|
239
|
+
};
|
|
240
|
+
}[];
|
|
241
|
+
};
|
|
242
|
+
export default _default;
|
|
243
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEzD,KAAK,WAAW,GAAG,EAAE,CAAC;AAItB,iBAAS,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4HlD;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvD,wBAA4B"}
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineConfig } from 'oxlint';
|
|
2
|
+
// const DEFAULT_OPTIONS: BaseOptions = {};
|
|
3
|
+
function baseConfig(_options) {
|
|
4
|
+
// const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
5
|
+
return defineConfig({
|
|
6
|
+
plugins: ['typescript', 'unicorn'],
|
|
7
|
+
jsPlugins: [],
|
|
8
|
+
categories: {
|
|
9
|
+
correctness: 'off',
|
|
10
|
+
},
|
|
11
|
+
env: {
|
|
12
|
+
builtin: true,
|
|
13
|
+
},
|
|
14
|
+
options: {
|
|
15
|
+
typeAware: true,
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
'constructor-super': 'error',
|
|
19
|
+
'for-direction': 'error',
|
|
20
|
+
'getter-return': 'error',
|
|
21
|
+
'no-async-promise-executor': 'error',
|
|
22
|
+
'no-case-declarations': 'error',
|
|
23
|
+
'no-class-assign': 'error',
|
|
24
|
+
'no-compare-neg-zero': 'error',
|
|
25
|
+
'no-cond-assign': 'error',
|
|
26
|
+
'no-const-assign': 'error',
|
|
27
|
+
'no-constant-binary-expression': 'error',
|
|
28
|
+
'no-constant-condition': 'error',
|
|
29
|
+
'no-control-regex': 'error',
|
|
30
|
+
'no-debugger': 'error',
|
|
31
|
+
'no-delete-var': 'error',
|
|
32
|
+
'no-dupe-class-members': 'error',
|
|
33
|
+
'no-dupe-else-if': 'error',
|
|
34
|
+
'no-dupe-keys': 'error',
|
|
35
|
+
'no-duplicate-case': 'error',
|
|
36
|
+
'no-empty': 'error',
|
|
37
|
+
'no-empty-character-class': 'error',
|
|
38
|
+
'no-empty-pattern': 'error',
|
|
39
|
+
'no-empty-static-block': 'error',
|
|
40
|
+
'no-ex-assign': 'error',
|
|
41
|
+
'no-extra-boolean-cast': 'error',
|
|
42
|
+
'no-fallthrough': 'error',
|
|
43
|
+
'no-func-assign': 'error',
|
|
44
|
+
'no-global-assign': 'error',
|
|
45
|
+
'no-import-assign': 'error',
|
|
46
|
+
'no-invalid-regexp': 'error',
|
|
47
|
+
'no-irregular-whitespace': 'error',
|
|
48
|
+
'no-loss-of-precision': 'error',
|
|
49
|
+
'no-misleading-character-class': 'error',
|
|
50
|
+
'no-new-native-nonconstructor': 'error',
|
|
51
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
52
|
+
'no-obj-calls': 'error',
|
|
53
|
+
'no-prototype-builtins': 'error',
|
|
54
|
+
'no-redeclare': 'error',
|
|
55
|
+
'no-regex-spaces': 'error',
|
|
56
|
+
'no-self-assign': 'error',
|
|
57
|
+
'no-setter-return': 'error',
|
|
58
|
+
'no-shadow-restricted-names': 'error',
|
|
59
|
+
'no-sparse-arrays': 'error',
|
|
60
|
+
'no-this-before-super': 'error',
|
|
61
|
+
'no-undef': 'error',
|
|
62
|
+
'no-unexpected-multiline': 'error',
|
|
63
|
+
'no-unreachable': 'error',
|
|
64
|
+
'no-unsafe-finally': 'error',
|
|
65
|
+
'no-unsafe-negation': 'error',
|
|
66
|
+
'no-unsafe-optional-chaining': 'error',
|
|
67
|
+
'no-unused-labels': 'error',
|
|
68
|
+
'no-unused-private-class-members': 'error',
|
|
69
|
+
'no-unused-vars': 'warn',
|
|
70
|
+
'no-useless-backreference': 'error',
|
|
71
|
+
'no-useless-catch': 'error',
|
|
72
|
+
'no-useless-escape': 'error',
|
|
73
|
+
'no-with': 'error',
|
|
74
|
+
'require-yield': 'error',
|
|
75
|
+
'use-isnan': 'error',
|
|
76
|
+
'valid-typeof': 'error',
|
|
77
|
+
'@typescript-eslint/ban-ts-comment': 'error',
|
|
78
|
+
'no-array-constructor': 'error',
|
|
79
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
80
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
81
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
82
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
83
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
84
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
85
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
86
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
87
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
88
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
89
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
90
|
+
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
91
|
+
'no-unused-expressions': 'warn',
|
|
92
|
+
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
93
|
+
'@typescript-eslint/prefer-as-const': 'error',
|
|
94
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
95
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
96
|
+
},
|
|
97
|
+
overrides: [
|
|
98
|
+
{
|
|
99
|
+
files: ['**/*.{ts,tsx,mts,cts}'],
|
|
100
|
+
rules: {
|
|
101
|
+
'constructor-super': 'off',
|
|
102
|
+
'getter-return': 'off',
|
|
103
|
+
'no-class-assign': 'off',
|
|
104
|
+
'no-const-assign': 'off',
|
|
105
|
+
'no-dupe-class-members': 'off',
|
|
106
|
+
'no-dupe-keys': 'off',
|
|
107
|
+
'no-func-assign': 'off',
|
|
108
|
+
'no-import-assign': 'off',
|
|
109
|
+
'no-new-native-nonconstructor': 'off',
|
|
110
|
+
'no-obj-calls': 'off',
|
|
111
|
+
'no-redeclare': 'off',
|
|
112
|
+
'no-setter-return': 'off',
|
|
113
|
+
'no-this-before-super': 'off',
|
|
114
|
+
'no-undef': 'off',
|
|
115
|
+
'no-unreachable': 'off',
|
|
116
|
+
'no-unsafe-negation': 'off',
|
|
117
|
+
'no-var': 'error',
|
|
118
|
+
'no-with': 'off',
|
|
119
|
+
'prefer-const': 'error',
|
|
120
|
+
'prefer-rest-params': 'error',
|
|
121
|
+
'prefer-spread': 'error',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export { defineConfig, baseConfig };
|
|
128
|
+
export default baseConfig();
|
|
129
|
+
//# sourceMappingURL=base.js.map
|
package/dist/base.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AAIzD,2CAA2C;AAE3C,SAAS,UAAU,CAAC,QAA+B;IACjD,mDAAmD;IAEnD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;QAClC,SAAS,EAAE,EAAE;QACb,UAAU,EAAE;YACV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,EAAE,KAAK;oBACvB,kBAAkB,EAAE,KAAK;oBACzB,8BAA8B,EAAE,KAAK;oBACrC,cAAc,EAAE,KAAK;oBACrB,cAAc,EAAE,KAAK;oBACrB,kBAAkB,EAAE,KAAK;oBACzB,sBAAsB,EAAE,KAAK;oBAC7B,UAAU,EAAE,KAAK;oBACjB,gBAAgB,EAAE,KAAK;oBACvB,oBAAoB,EAAE,KAAK;oBAC3B,QAAQ,EAAE,OAAO;oBACjB,SAAS,EAAE,KAAK;oBAChB,cAAc,EAAE,OAAO;oBACvB,oBAAoB,EAAE,OAAO;oBAC7B,eAAe,EAAE,OAAO;iBACzB;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAqB,YAAY,EAAE,UAAU,EAAE,CAAC;AAEvD,eAAe,UAAU,EAAE,CAAC"}
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig, type OxlintConfig } from 'oxlint';
|
|
2
|
+
import { type ReactOptions } from './react.js';
|
|
3
|
+
type NextOptions = ReactOptions & {
|
|
4
|
+
/**
|
|
5
|
+
* Sets the parent directory of UI components to ignore them in react-refresh.
|
|
6
|
+
* This allows multiple exports from the same file, which is common when using libraries like class-variance-authority.
|
|
7
|
+
*
|
|
8
|
+
* Set to `null` to disable react-refresh suppression for UI components.
|
|
9
|
+
*
|
|
10
|
+
* Defaults to `src/components/ui/`.
|
|
11
|
+
*/
|
|
12
|
+
uiPath: string | null;
|
|
13
|
+
};
|
|
14
|
+
declare function nextConfig(options?: Partial<NextOptions>): OxlintConfig;
|
|
15
|
+
export { type OxlintConfig, defineConfig, nextConfig };
|
|
16
|
+
declare const _default: OxlintConfig;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,YAAY,CAAC;AAG5D,KAAK,WAAW,GAAG,YAAY,GAAG;IAChC;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAIF,iBAAS,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,gBA4DjD;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;;AAEvD,wBAA4B"}
|