@4mbl/lint 0.0.0-beta.6d969e6 → 0.0.0-beta.729fc99

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 CHANGED
@@ -1,5 +1,121 @@
1
1
  # @4mbl/lint
2
2
 
3
+ ## 1.0.0-beta.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2c338b1: fix(lint): re-export `OxlintConfig` to make config portable
8
+
9
+ ## 1.0.0-beta.0
10
+
11
+ ### Major Changes
12
+
13
+ - c65e34e: Add CLI to allow default arguments and easier tool migration in the future
14
+ - c65e34e: Migrate from eslint to oxlint
15
+
16
+ ## 0.16.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 6878a35: Upgrade config dependencies
21
+
22
+ ## 0.15.0
23
+
24
+ ### Minor Changes
25
+
26
+ - 5040323: Upgrade config dependencies
27
+
28
+ ## 0.14.0
29
+
30
+ ### Minor Changes
31
+
32
+ - 794dbfb: Upgrade config dependencies
33
+ - e6a08fd: Upgrade to ESLint 10
34
+
35
+ ## 0.13.0
36
+
37
+ ### Minor Changes
38
+
39
+ - ac23f1d: Upgrade config dependencies
40
+
41
+ ## 0.12.0
42
+
43
+ ### Minor Changes
44
+
45
+ - dd16619: Upgrade config dependencies
46
+
47
+ ## 0.11.0
48
+
49
+ ### Minor Changes
50
+
51
+ - e011cd6: Upgrade config dependencies
52
+
53
+ ## 0.10.0
54
+
55
+ ### Minor Changes
56
+
57
+ - 774cb2a: Upgrade config dependencies
58
+
59
+ ## 0.9.0
60
+
61
+ ### Minor Changes
62
+
63
+ - aee78b7: Upgrade config dependencies
64
+
65
+ ## 0.8.0
66
+
67
+ ### Minor Changes
68
+
69
+ - 152396b: Upgrade config dependencies
70
+
71
+ ## 0.7.0
72
+
73
+ ### Minor Changes
74
+
75
+ - 8e46d6b: Upgrade config dependencies
76
+
77
+ ### Patch Changes
78
+
79
+ - 8e46d6b: Re-export types with type-keyword to fix verbatimModuleSyntax
80
+
81
+ ## 0.6.0
82
+
83
+ ### Minor Changes
84
+
85
+ - 46d0443: Upgrade config dependencies
86
+
87
+ ## 0.5.0
88
+
89
+ ### Minor Changes
90
+
91
+ - 55c3db6: Export `defineConfig` from eslint
92
+ - f7d30bb: Upgrade config dependencies
93
+
94
+ ## 0.4.0
95
+
96
+ ### Minor Changes
97
+
98
+ - 00cfefd: Add node template
99
+
100
+ ## 0.3.2
101
+
102
+ ### Patch Changes
103
+
104
+ - df1c48b: Re-export eslint Config type from react template
105
+
106
+ ## 0.3.1
107
+
108
+ ### Patch Changes
109
+
110
+ - d17fc69: Fix react template export
111
+
112
+ ## 0.3.0
113
+
114
+ ### Minor Changes
115
+
116
+ - 6d969e6: Add react template
117
+ - 6d969e6: Upgrade eslint and config dependencies
118
+
3
119
  ## 0.2.1
4
120
 
5
121
  ### Patch Changes
package/README.md CHANGED
@@ -2,12 +2,17 @@
2
2
 
3
3
  > Linting configuration for various environments.
4
4
 
5
- * [Usage](#usage)
6
- * [Available templates](#available-templates)
7
- * [Versioning](#versioning)
5
+ - [Usage](#usage)
6
+ - [Running `lint` CLI wrapper](#running-lint-cli-wrapper)
7
+ - [Running `oxlint` directly](#running-oxlint-directly)
8
+ - [Available templates](#available-templates)
9
+ - [Versioning](#versioning)
8
10
 
9
11
  ---
10
12
 
13
+ > [!NOTE]
14
+ > This package currently uses [oxlint](https://www.npmjs.com/package/oxlint) as the underlying linting tool. That may change in a future major release.
15
+
11
16
  ## Usage
12
17
 
13
18
  Install the [`@4mbl/lint`](https://www.npmjs.com/package/@4mbl/lint) package.
@@ -16,40 +21,56 @@ Install the [`@4mbl/lint`](https://www.npmjs.com/package/@4mbl/lint) package.
16
21
  npm install -D @4mbl/lint
17
22
  ```
18
23
 
19
- Create a `eslint.config.ts` file in the root of your project with the desired configuration. This package currently uses eslint. That might change in a future major release.
24
+ Create a `oxlint.config.ts` file for your package. If you are using a monorepo, create a `oxlint.config.ts` for each package in the monorepo.
20
25
 
21
26
  ```js
22
- import defaultConfig, { type Config } from '@4mbl/lint/next'; // <-- change `next` to the desired template
27
+ import defineConfig from '@4mbl/lint/next'; // <-- change `next` to the desired template
23
28
 
24
- export default [...defaultConfig] satisfies Config[];
29
+ export default defineConfig();
25
30
  ```
26
31
 
27
- Set a script that uses the linting package.
32
+ ### Running `lint` CLI wrapper
33
+
34
+ This is the recommended way as it abstracts away the underlying linting package and allows us to change it in the future. While we try to keep the CLI wrapper interface stable between possible tooling changes, it is inevitable to have breaking changes if the underlying tooling changes.
35
+
36
+ Set a script that uses the linting CLI wrapper in your `package.json`. While it may be tempting to just call `lint` directly in CI or locally, it is recommended to use a script as it allows additional arguments to be passed to the CLI wrapper.
28
37
 
29
38
  ```shell
30
- npm pkg set scripts.lint="eslint src"
39
+ npm pkg set scripts.lint="lint"
40
+ ```
41
+
42
+ The CLI wrapper uses the `src` directory by default and the following arguments:
43
+
44
+ - `--max-warnings=0`
45
+ - `--report-unused-disable-directives`
46
+
47
+ These arguments can be overridden by passing them explicitly to the CLI wrapper.
48
+
49
+ ### Running `oxlint` directly
50
+
51
+ ```shell
52
+ npm pkg set scripts.lint="oxlint src"
31
53
  ```
32
54
 
33
55
  You may need to explicitly allow the underlying linting packages to be used by your scripts.
34
56
 
35
- For example, when using pnpm, you need to set `publicHoistPattern` in your `pnpm-workspace.yaml` for ESLint.
57
+ For example, when using pnpm, you need to set `publicHoistPattern` in your `pnpm-workspace.yaml`.
36
58
 
37
59
  ```yaml
38
60
  publicHoistPattern:
39
- - eslint
61
+ - oxlint
40
62
  ```
41
63
 
42
64
  ## Available templates
43
65
 
44
- There is currently one config template.
66
+ These are the currently available config templates.
45
67
 
46
- - **Next** - Linting configuration extending the Next.js default config.
47
- - **React** - Linting configuration extending the Vite-React default config.
68
+ - **Next** - Extending the Next.js linting config.
69
+ - **Node** - Linting configuration for Node.js.
70
+ - **React** - Extending the Vite-React linting config.
48
71
 
49
72
  ## Versioning
50
73
 
51
- _Until v1.0.0 is released, breaking changes may be introduced in minor releases without prior warnings._
52
-
53
74
  The package follows the following versioning scheme: `X.Y.Z`.
54
75
 
55
76
  - `X` - Reserved for linting provider changes as those might cause wider backwards compatibility issues.
package/bin/cli.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from 'node:child_process';
4
+
5
+ const args = process.argv.slice(2);
6
+
7
+ const hasPath = args.some((a) => !a.startsWith('-'));
8
+ const hasMaxWarn = args.some((a) => a.startsWith('--max-warnings'));
9
+ const hasReportUnused = args.some((a) =>
10
+ a.startsWith('--report-unused-disable-directives'),
11
+ );
12
+
13
+ const finalArgs = [
14
+ ...(hasPath ? [] : ['src']),
15
+ ...(hasMaxWarn ? [] : ['--max-warnings=0']),
16
+ ...(hasReportUnused ? [] : ['--report-unused-disable-directives']),
17
+ ...args,
18
+ ];
19
+
20
+ const result = spawnSync('oxlint', finalArgs, {
21
+ stdio: 'inherit',
22
+ shell: true,
23
+ });
24
+
25
+ process.exit(result.status ?? 1);
package/dist/base.d.ts ADDED
@@ -0,0 +1,124 @@
1
+ import { type OxlintConfig } from 'oxlint';
2
+ type BaseOptions = {
3
+ uiPath: string;
4
+ };
5
+ export default function (_options?: Partial<BaseOptions>): {
6
+ plugins: ("unicorn" | "typescript")[];
7
+ jsPlugins: never[];
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-unreachable': "error";
63
+ 'no-unsafe-finally': "error";
64
+ 'no-unsafe-negation': "error";
65
+ 'no-unsafe-optional-chaining': "error";
66
+ 'no-unused-labels': "error";
67
+ 'no-unused-private-class-members': "error";
68
+ 'no-unused-vars': "warn";
69
+ 'no-useless-backreference': "error";
70
+ 'no-useless-catch': "error";
71
+ 'no-useless-escape': "error";
72
+ 'no-with': "error";
73
+ 'require-yield': "error";
74
+ 'use-isnan': "error";
75
+ 'valid-typeof': "error";
76
+ '@typescript-eslint/ban-ts-comment': "error";
77
+ 'no-array-constructor': "error";
78
+ '@typescript-eslint/no-duplicate-enum-values': "error";
79
+ '@typescript-eslint/no-empty-object-type': "error";
80
+ '@typescript-eslint/no-explicit-any': "error";
81
+ '@typescript-eslint/no-extra-non-null-assertion': "error";
82
+ '@typescript-eslint/no-misused-new': "error";
83
+ '@typescript-eslint/no-namespace': "error";
84
+ '@typescript-eslint/no-non-null-asserted-optional-chain': "error";
85
+ '@typescript-eslint/no-require-imports': "error";
86
+ '@typescript-eslint/no-this-alias': "error";
87
+ '@typescript-eslint/no-unnecessary-type-constraint': "error";
88
+ '@typescript-eslint/no-unsafe-declaration-merging': "error";
89
+ '@typescript-eslint/no-unsafe-function-type': "error";
90
+ 'no-unused-expressions': "warn";
91
+ '@typescript-eslint/no-wrapper-object-types': "error";
92
+ '@typescript-eslint/prefer-as-const': "error";
93
+ '@typescript-eslint/prefer-namespace-keyword': "error";
94
+ '@typescript-eslint/triple-slash-reference': "error";
95
+ };
96
+ overrides: {
97
+ files: string[];
98
+ rules: {
99
+ 'constructor-super': "off";
100
+ 'getter-return': "off";
101
+ 'no-class-assign': "off";
102
+ 'no-const-assign': "off";
103
+ 'no-dupe-class-members': "off";
104
+ 'no-dupe-keys': "off";
105
+ 'no-func-assign': "off";
106
+ 'no-import-assign': "off";
107
+ 'no-new-native-nonconstructor': "off";
108
+ 'no-obj-calls': "off";
109
+ 'no-redeclare': "off";
110
+ 'no-setter-return': "off";
111
+ 'no-this-before-super': "off";
112
+ 'no-undef': "off";
113
+ 'no-unreachable': "off";
114
+ 'no-unsafe-negation': "off";
115
+ 'no-var': "error";
116
+ 'no-with': "off";
117
+ 'prefer-const': "error";
118
+ 'prefer-rest-params': "error";
119
+ 'prefer-spread': "error";
120
+ };
121
+ }[];
122
+ };
123
+ export type { OxlintConfig };
124
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEzD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HvD;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
package/dist/base.js ADDED
@@ -0,0 +1,126 @@
1
+ import { defineConfig } from 'oxlint';
2
+ // const DEFAULT_OPTIONS: BaseOptions = {};
3
+ export default function (_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-unreachable': 'error',
63
+ 'no-unsafe-finally': 'error',
64
+ 'no-unsafe-negation': 'error',
65
+ 'no-unsafe-optional-chaining': 'error',
66
+ 'no-unused-labels': 'error',
67
+ 'no-unused-private-class-members': 'error',
68
+ 'no-unused-vars': 'warn',
69
+ 'no-useless-backreference': 'error',
70
+ 'no-useless-catch': 'error',
71
+ 'no-useless-escape': 'error',
72
+ 'no-with': 'error',
73
+ 'require-yield': 'error',
74
+ 'use-isnan': 'error',
75
+ 'valid-typeof': 'error',
76
+ '@typescript-eslint/ban-ts-comment': 'error',
77
+ 'no-array-constructor': 'error',
78
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
79
+ '@typescript-eslint/no-empty-object-type': 'error',
80
+ '@typescript-eslint/no-explicit-any': 'error',
81
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
82
+ '@typescript-eslint/no-misused-new': 'error',
83
+ '@typescript-eslint/no-namespace': 'error',
84
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
85
+ '@typescript-eslint/no-require-imports': 'error',
86
+ '@typescript-eslint/no-this-alias': 'error',
87
+ '@typescript-eslint/no-unnecessary-type-constraint': 'error',
88
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
89
+ '@typescript-eslint/no-unsafe-function-type': 'error',
90
+ 'no-unused-expressions': 'warn',
91
+ '@typescript-eslint/no-wrapper-object-types': 'error',
92
+ '@typescript-eslint/prefer-as-const': 'error',
93
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
94
+ '@typescript-eslint/triple-slash-reference': 'error',
95
+ },
96
+ overrides: [
97
+ {
98
+ files: ['**/*.{ts,tsx,mts,cts}'],
99
+ rules: {
100
+ 'constructor-super': 'off',
101
+ 'getter-return': 'off',
102
+ 'no-class-assign': 'off',
103
+ 'no-const-assign': 'off',
104
+ 'no-dupe-class-members': 'off',
105
+ 'no-dupe-keys': 'off',
106
+ 'no-func-assign': 'off',
107
+ 'no-import-assign': 'off',
108
+ 'no-new-native-nonconstructor': 'off',
109
+ 'no-obj-calls': 'off',
110
+ 'no-redeclare': 'off',
111
+ 'no-setter-return': 'off',
112
+ 'no-this-before-super': 'off',
113
+ 'no-undef': 'off',
114
+ 'no-unreachable': 'off',
115
+ 'no-unsafe-negation': 'off',
116
+ 'no-var': 'error',
117
+ 'no-with': 'off',
118
+ 'prefer-const': 'error',
119
+ 'prefer-rest-params': 'error',
120
+ 'prefer-spread': 'error',
121
+ },
122
+ },
123
+ ],
124
+ });
125
+ }
126
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AAMzD,2CAA2C;AAE3C,MAAM,CAAC,OAAO,WAAW,QAA+B;IACtD,mDAAmD;IAEnD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;QAClC,SAAS,EAAE,EAAE;QACb,UAAU,EAAE;YACV,WAAW,EAAE,KAAK;SACnB;QACD,GAAG,EAAE;YACH,OAAO,EAAE,IAAI;SACd;QACD,OAAO,EAAE;YACP,SAAS,EAAE,IAAI;SAChB;QACD,KAAK,EAAE;YACL,mBAAmB,EAAE,OAAO;YAC5B,eAAe,EAAE,OAAO;YACxB,eAAe,EAAE,OAAO;YACxB,2BAA2B,EAAE,OAAO;YACpC,sBAAsB,EAAE,OAAO;YAC/B,iBAAiB,EAAE,OAAO;YAC1B,qBAAqB,EAAE,OAAO;YAC9B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B,EAAE,OAAO;oBAC7B,eAAe,EAAE,OAAO;iBACzB;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
package/dist/next.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { 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
+ export default function (options?: Partial<NextOptions>): OxlintConfig;
15
+ export type { OxlintConfig };
16
+ //# sourceMappingURL=next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAc,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAGtD,KAAK,WAAW,GAAG,YAAY,GAAG;IAChC;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAIF,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,gBA4DtD;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
package/dist/next.js ADDED
@@ -0,0 +1,60 @@
1
+ import { defineConfig } from 'oxlint';
2
+ import react, {} from './react.js';
3
+ import reactRefresh from 'eslint-plugin-react-refresh';
4
+ const DEFAULT_OPTIONS = { uiPath: 'src/components/ui/' };
5
+ export default function (options) {
6
+ const opts = { ...DEFAULT_OPTIONS, ...options };
7
+ return defineConfig({
8
+ extends: [react(options)],
9
+ plugins: ['nextjs'],
10
+ rules: {
11
+ '@next/next/google-font-display': 'warn',
12
+ '@next/next/google-font-preconnect': 'warn',
13
+ '@next/next/next-script-for-ga': 'warn',
14
+ '@next/next/no-async-client-component': 'warn',
15
+ '@next/next/no-before-interactive-script-outside-document': 'warn',
16
+ '@next/next/no-css-tags': 'warn',
17
+ '@next/next/no-head-element': 'warn',
18
+ '@next/next/no-html-link-for-pages': 'error',
19
+ '@next/next/no-page-custom-font': 'warn',
20
+ '@next/next/no-styled-jsx-in-document': 'warn',
21
+ '@next/next/no-sync-scripts': 'error',
22
+ '@next/next/no-title-in-document-head': 'warn',
23
+ '@next/next/no-typos': 'warn',
24
+ '@next/next/no-unwanted-polyfillio': 'warn',
25
+ '@next/next/inline-script-id': 'error',
26
+ '@next/next/no-assign-module-variable': 'error',
27
+ '@next/next/no-document-import-in-page': 'error',
28
+ '@next/next/no-duplicate-head': 'error',
29
+ '@next/next/no-head-import-in-document': 'error',
30
+ '@next/next/no-script-component-in-head': 'error',
31
+ },
32
+ ignorePatterns: ['.next/**', 'out/**', 'build/**', 'next-env.d.ts'],
33
+ overrides: [
34
+ // ignores warnings for special exports in page and layout files
35
+ // https://github.com/ArnaudBarre/eslint-plugin-react-refresh?tab=readme-ov-file#next-config
36
+ {
37
+ files: ['**/*.{js,jsx,mjs,ts,tsx,mts,cts}'],
38
+ rules: {
39
+ 'react-refresh-js/only-export-components': [
40
+ 'error',
41
+ {
42
+ allowExportNames: reactRefresh.configs.next.rules['react-refresh/only-export-components'][1]['allowExportNames'],
43
+ },
44
+ ],
45
+ },
46
+ },
47
+ opts.uiPath === null
48
+ ? { files: [], rules: {} }
49
+ : {
50
+ files: [
51
+ `${opts.uiPath}/**/*.{js,jsx,mjs,ts,tsx,mts,cts}`.replaceAll('//', '/'),
52
+ ],
53
+ rules: {
54
+ 'react-refresh-js/only-export-components': 'off',
55
+ },
56
+ },
57
+ ],
58
+ });
59
+ }
60
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,EA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C,OAAO,CAAC,IAAI,CAAC,KAAa,CACxD,sCAAsC,CACvC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;yBACzB;qBACF;iBACF;aACF;YACD,IAAI,CAAC,MAAM,KAAK,IAAI;gBAClB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;gBAC1B,CAAC,CAAC;oBACE,KAAK,EAAE;wBACL,GAAG,IAAI,CAAC,MAAM,mCAAmC,CAAC,UAAU,CAC1D,IAAI,EACJ,GAAG,CACJ;qBACF;oBACD,KAAK,EAAE;wBACL,yCAAyC,EAAE,KAAK;qBACjD;iBACF;SACN;KACF,CAAC,CAAC;AACL,CAAC"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,124 @@
1
+ import { type OxlintConfig } from 'oxlint';
2
+ type NodeOptions = {};
3
+ export default function (_options?: Partial<NodeOptions>): {
4
+ extends: {
5
+ plugins: ("unicorn" | "typescript")[];
6
+ jsPlugins: never[];
7
+ categories: {
8
+ correctness: "off";
9
+ };
10
+ env: {
11
+ builtin: true;
12
+ };
13
+ options: {
14
+ typeAware: true;
15
+ };
16
+ rules: {
17
+ 'constructor-super': "error";
18
+ 'for-direction': "error";
19
+ 'getter-return': "error";
20
+ 'no-async-promise-executor': "error";
21
+ 'no-case-declarations': "error";
22
+ 'no-class-assign': "error";
23
+ 'no-compare-neg-zero': "error";
24
+ 'no-cond-assign': "error";
25
+ 'no-const-assign': "error";
26
+ 'no-constant-binary-expression': "error";
27
+ 'no-constant-condition': "error";
28
+ 'no-control-regex': "error";
29
+ 'no-debugger': "error";
30
+ 'no-delete-var': "error";
31
+ 'no-dupe-class-members': "error";
32
+ 'no-dupe-else-if': "error";
33
+ 'no-dupe-keys': "error";
34
+ 'no-duplicate-case': "error";
35
+ 'no-empty': "error";
36
+ 'no-empty-character-class': "error";
37
+ 'no-empty-pattern': "error";
38
+ 'no-empty-static-block': "error";
39
+ 'no-ex-assign': "error";
40
+ 'no-extra-boolean-cast': "error";
41
+ 'no-fallthrough': "error";
42
+ 'no-func-assign': "error";
43
+ 'no-global-assign': "error";
44
+ 'no-import-assign': "error";
45
+ 'no-invalid-regexp': "error";
46
+ 'no-irregular-whitespace': "error";
47
+ 'no-loss-of-precision': "error";
48
+ 'no-misleading-character-class': "error";
49
+ 'no-new-native-nonconstructor': "error";
50
+ 'no-nonoctal-decimal-escape': "error";
51
+ 'no-obj-calls': "error";
52
+ 'no-prototype-builtins': "error";
53
+ 'no-redeclare': "error";
54
+ 'no-regex-spaces': "error";
55
+ 'no-self-assign': "error";
56
+ 'no-setter-return': "error";
57
+ 'no-shadow-restricted-names': "error";
58
+ 'no-sparse-arrays': "error";
59
+ 'no-this-before-super': "error";
60
+ 'no-undef': "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
+ };
123
+ export type { OxlintConfig };
124
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,KAAK,WAAW,GAAG,EAAE,CAAC;AAItB,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKvD;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
package/dist/node.js ADDED
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'oxlint';
2
+ import base from './base.js';
3
+ // const DEFAULT_OPTIONS: NodeOptions = {};
4
+ export default function (_options) {
5
+ // const opts = { ...DEFAULT_OPTIONS, ...options };
6
+ return defineConfig({
7
+ extends: [base()],
8
+ });
9
+ }
10
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,2CAA2C;AAE3C,MAAM,CAAC,OAAO,WAAW,QAA+B;IACtD,mDAAmD;IACnD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;KAClB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,183 @@
1
+ import { type OxlintConfig } from 'oxlint';
2
+ export type ReactOptions = {};
3
+ export default function (_options?: Partial<ReactOptions>): {
4
+ extends: {
5
+ plugins: ("unicorn" | "typescript")[];
6
+ jsPlugins: never[];
7
+ categories: {
8
+ correctness: "off";
9
+ };
10
+ env: {
11
+ builtin: true;
12
+ };
13
+ options: {
14
+ typeAware: true;
15
+ };
16
+ rules: {
17
+ 'constructor-super': "error";
18
+ 'for-direction': "error";
19
+ 'getter-return': "error";
20
+ 'no-async-promise-executor': "error";
21
+ 'no-case-declarations': "error";
22
+ 'no-class-assign': "error";
23
+ 'no-compare-neg-zero': "error";
24
+ 'no-cond-assign': "error";
25
+ 'no-const-assign': "error";
26
+ 'no-constant-binary-expression': "error";
27
+ 'no-constant-condition': "error";
28
+ 'no-control-regex': "error";
29
+ 'no-debugger': "error";
30
+ 'no-delete-var': "error";
31
+ 'no-dupe-class-members': "error";
32
+ 'no-dupe-else-if': "error";
33
+ 'no-dupe-keys': "error";
34
+ 'no-duplicate-case': "error";
35
+ 'no-empty': "error";
36
+ 'no-empty-character-class': "error";
37
+ 'no-empty-pattern': "error";
38
+ 'no-empty-static-block': "error";
39
+ 'no-ex-assign': "error";
40
+ 'no-extra-boolean-cast': "error";
41
+ 'no-fallthrough': "error";
42
+ 'no-func-assign': "error";
43
+ 'no-global-assign': "error";
44
+ 'no-import-assign': "error";
45
+ 'no-invalid-regexp': "error";
46
+ 'no-irregular-whitespace': "error";
47
+ 'no-loss-of-precision': "error";
48
+ 'no-misleading-character-class': "error";
49
+ 'no-new-native-nonconstructor': "error";
50
+ 'no-nonoctal-decimal-escape': "error";
51
+ 'no-obj-calls': "error";
52
+ 'no-prototype-builtins': "error";
53
+ 'no-redeclare': "error";
54
+ 'no-regex-spaces': "error";
55
+ 'no-self-assign': "error";
56
+ 'no-setter-return': "error";
57
+ 'no-shadow-restricted-names': "error";
58
+ 'no-sparse-arrays': "error";
59
+ 'no-this-before-super': "error";
60
+ 'no-undef': "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
+ plugins: "react"[];
123
+ jsPlugins: {
124
+ name: string;
125
+ specifier: string;
126
+ }[];
127
+ rules: {
128
+ 'react-hooks-js/rules-of-hooks': "error";
129
+ 'react-hooks-js/exhaustive-deps': "warn";
130
+ 'react-hooks-js/set-state-in-effect': "warn";
131
+ 'react-refresh-js/only-export-components': "error";
132
+ 'react-compiler-js/react-compiler': "error";
133
+ };
134
+ overrides: {
135
+ files: string[];
136
+ rules: {
137
+ 'react/display-name': "error";
138
+ 'react/jsx-key': "error";
139
+ 'react/jsx-no-comment-textnodes': "error";
140
+ 'react/jsx-no-duplicate-props': "error";
141
+ 'react/jsx-no-target-blank': "off";
142
+ 'react/jsx-no-undef': "error";
143
+ 'react/no-children-prop': "error";
144
+ 'react/no-danger-with-children': "error";
145
+ 'react/no-direct-mutation-state': "error";
146
+ 'react/no-find-dom-node': "error";
147
+ 'react/no-is-mounted': "error";
148
+ 'react/no-render-return-value': "error";
149
+ 'react/no-string-refs': "error";
150
+ 'react/no-unescaped-entities': "error";
151
+ 'react/no-unknown-property': "off";
152
+ 'react/no-unsafe': "off";
153
+ 'react/react-in-jsx-scope': "off";
154
+ 'react/require-render-return': "error";
155
+ 'import/no-anonymous-default-export': "warn";
156
+ 'jsx-a11y/alt-text': (string | {
157
+ elements: string[];
158
+ img: string[];
159
+ })[];
160
+ 'jsx-a11y/aria-props': "warn";
161
+ 'jsx-a11y/aria-proptypes': "warn";
162
+ 'jsx-a11y/aria-unsupported-elements': "warn";
163
+ 'jsx-a11y/role-has-required-aria-props': "warn";
164
+ 'jsx-a11y/role-supports-aria-props': "warn";
165
+ };
166
+ globals: {
167
+ AudioWorkletGlobalScope: "readonly";
168
+ AudioWorkletProcessor: "readonly";
169
+ currentFrame: "readonly";
170
+ currentTime: "readonly";
171
+ registerProcessor: "readonly";
172
+ sampleRate: "readonly";
173
+ WorkletGlobalScope: "readonly";
174
+ };
175
+ plugins: ("import" | "jsx-a11y")[];
176
+ env: {
177
+ browser: true;
178
+ node: true;
179
+ };
180
+ }[];
181
+ };
182
+ export type { OxlintConfig };
183
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAI9B,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkExD;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
package/dist/react.js ADDED
@@ -0,0 +1,70 @@
1
+ import { defineConfig } from 'oxlint';
2
+ import base from './base.js';
3
+ // const DEFAULT_OPTIONS: ReactOptions = {};
4
+ export default function (_options) {
5
+ // const opts = { ...DEFAULT_OPTIONS, ...options };
6
+ return defineConfig({
7
+ extends: [base()],
8
+ plugins: ['react'],
9
+ jsPlugins: [
10
+ { name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' },
11
+ { name: 'react-refresh-js', specifier: 'eslint-plugin-react-refresh' },
12
+ { name: 'react-compiler-js', specifier: 'eslint-plugin-react-compiler' },
13
+ ],
14
+ rules: {
15
+ 'react-hooks-js/rules-of-hooks': 'error',
16
+ 'react-hooks-js/exhaustive-deps': 'warn',
17
+ 'react-hooks-js/set-state-in-effect': 'warn',
18
+ 'react-refresh-js/only-export-components': 'error',
19
+ 'react-compiler-js/react-compiler': 'error',
20
+ },
21
+ overrides: [
22
+ {
23
+ files: ['**/*.{js,jsx,mjs,ts,tsx,mts,cts}'],
24
+ rules: {
25
+ 'react/display-name': 'error',
26
+ 'react/jsx-key': 'error',
27
+ 'react/jsx-no-comment-textnodes': 'error',
28
+ 'react/jsx-no-duplicate-props': 'error',
29
+ 'react/jsx-no-target-blank': 'off',
30
+ 'react/jsx-no-undef': 'error',
31
+ 'react/no-children-prop': 'error',
32
+ 'react/no-danger-with-children': 'error',
33
+ // "react/no-deprecated": "error", // not implemented yet in oxlint
34
+ 'react/no-direct-mutation-state': 'error',
35
+ 'react/no-find-dom-node': 'error',
36
+ 'react/no-is-mounted': 'error',
37
+ 'react/no-render-return-value': 'error',
38
+ 'react/no-string-refs': 'error',
39
+ 'react/no-unescaped-entities': 'error',
40
+ 'react/no-unknown-property': 'off',
41
+ 'react/no-unsafe': 'off',
42
+ 'react/react-in-jsx-scope': 'off',
43
+ 'react/require-render-return': 'error',
44
+ 'import/no-anonymous-default-export': 'warn',
45
+ 'jsx-a11y/alt-text': ['warn', { elements: ['img'], img: ['Image'] }],
46
+ 'jsx-a11y/aria-props': 'warn',
47
+ 'jsx-a11y/aria-proptypes': 'warn',
48
+ 'jsx-a11y/aria-unsupported-elements': 'warn',
49
+ 'jsx-a11y/role-has-required-aria-props': 'warn',
50
+ 'jsx-a11y/role-supports-aria-props': 'warn',
51
+ },
52
+ globals: {
53
+ AudioWorkletGlobalScope: 'readonly',
54
+ AudioWorkletProcessor: 'readonly',
55
+ currentFrame: 'readonly',
56
+ currentTime: 'readonly',
57
+ registerProcessor: 'readonly',
58
+ sampleRate: 'readonly',
59
+ WorkletGlobalScope: 'readonly',
60
+ },
61
+ plugins: ['import', 'jsx-a11y'],
62
+ env: {
63
+ browser: true,
64
+ node: true,
65
+ },
66
+ },
67
+ ],
68
+ });
69
+ }
70
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,4CAA4C;AAE5C,MAAM,CAAC,OAAO,WAAW,QAAgC;IACvD,mDAAmD;IAEnD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,2BAA2B,EAAE;YAClE,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,6BAA6B,EAAE;YACtE,EAAE,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAE,8BAA8B,EAAE;SACzE;QACD,KAAK,EAAE;YACL,+BAA+B,EAAE,OAAO;YACxC,gCAAgC,EAAE,MAAM;YACxC,oCAAoC,EAAE,MAAM;YAC5C,yCAAyC,EAAE,OAAO;Y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,IAAI;oBACb,IAAI,EAAE,IAAI;iBACX;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,16 +1,23 @@
1
1
  {
2
2
  "name": "@4mbl/lint",
3
- "version": "0.0.0-beta.6d969e6",
3
+ "version": "0.0.0-beta.729fc99",
4
4
  "description": "Linting configuration for various environments.",
5
5
  "type": "module",
6
6
  "author": "4mbl",
7
7
  "license": "MIT",
8
8
  "homepage": "https://github.com/4mbl/config/tree/main/packages/lint#readme",
9
9
  "exports": {
10
- "./next": "./src/next.ts"
10
+ "./*": {
11
+ "types": "./dist/*.d.ts",
12
+ "development": "./src/*.ts",
13
+ "default": "./dist/*.js"
14
+ }
15
+ },
16
+ "bin": {
17
+ "lint": "./bin/cli.js"
11
18
  },
12
19
  "files": [
13
- "src",
20
+ "dist",
14
21
  "package.json",
15
22
  "README.md",
16
23
  "CHANGELOG.md"
@@ -24,16 +31,18 @@
24
31
  "lint"
25
32
  ],
26
33
  "dependencies": {
27
- "@eslint/js": "^9.39.1",
28
- "eslint": "^9.39.1",
29
- "eslint-config-next": "^16.0.3",
30
- "eslint-config-prettier": "^10.1.8",
31
34
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
32
35
  "eslint-plugin-react-hooks": "^7.0.1",
33
- "eslint-plugin-react-refresh": "^0.4.24",
34
- "globals": "^16.5.0",
36
+ "eslint-plugin-react-refresh": "^0.5.2",
37
+ "globals": "^17.4.0",
35
38
  "jiti": "^2.6.1",
36
- "typescript-eslint": "^8.47.0"
39
+ "oxlint": "^1.56.0",
40
+ "oxlint-tsgolint": "^0.17.0"
41
+ },
42
+ "devDependencies": {
43
+ "@4mbl/tsconfig": "0.0.0-beta.729fc99"
37
44
  },
38
- "scripts": {}
45
+ "scripts": {
46
+ "build": "tsc"
47
+ }
39
48
  }
package/src/next.ts DELETED
@@ -1,34 +0,0 @@
1
- // @ts-nocheck
2
- import js from '@eslint/js';
3
- import nextVitals from 'eslint-config-next/core-web-vitals';
4
- import nextTs from 'eslint-config-next/typescript';
5
- import prettier from 'eslint-config-prettier/flat';
6
- import * as reactCompiler from 'eslint-plugin-react-compiler';
7
- import reactHooks from 'eslint-plugin-react-hooks';
8
- import { Config, defineConfig, globalIgnores } from 'eslint/config';
9
- import tseslint from 'typescript-eslint';
10
-
11
- export { Config };
12
-
13
- export default defineConfig([
14
- js.configs.recommended,
15
- ...tseslint.configs.recommended,
16
- {
17
- languageOptions: {
18
- parserOptions: {
19
- tsconfigRootDir: (import.meta as any).dirname,
20
- },
21
- },
22
- },
23
- ...nextVitals,
24
- ...nextTs,
25
- reactHooks.configs.flat.recommended,
26
- reactCompiler.configs.recommended,
27
- {
28
- rules: {
29
- 'react-compiler/react-compiler': 'error',
30
- },
31
- },
32
- prettier,
33
- globalIgnores(['.next/**', 'out/**', 'build/**', 'next-env.d.ts']),
34
- ]) satisfies Config[];
package/src/react.ts DELETED
@@ -1,32 +0,0 @@
1
- import js from '@eslint/js';
2
- import prettier from 'eslint-config-prettier/flat';
3
- import reactHooks from 'eslint-plugin-react-hooks';
4
- import reactRefresh from 'eslint-plugin-react-refresh';
5
- import { defineConfig, globalIgnores } from 'eslint/config';
6
- import globals from 'globals';
7
- import tseslint from 'typescript-eslint';
8
-
9
- export default defineConfig([
10
- js.configs.recommended,
11
- tseslint.configs.recommended,
12
-
13
- reactHooks.configs.flat.recommended,
14
- reactRefresh.configs.recommended,
15
-
16
- globalIgnores(['dist']),
17
- {
18
- files: ['**/*.{ts,tsx}'],
19
- languageOptions: {
20
- ecmaVersion: 2020,
21
- globals: globals.browser,
22
- },
23
- rules: {
24
- 'react-refresh/only-export-components': [
25
- 'warn',
26
- { allowConstantExport: true },
27
- ],
28
- },
29
- },
30
-
31
- prettier,
32
- ]);