@4mbl/lint 0.0.0-beta.b5d5914 → 0.0.0-beta.ba4500a

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,37 @@
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
+
3
35
  ## 0.13.0
4
36
 
5
37
  ### Minor 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,27 +21,44 @@ 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, { defineConfig } 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 defineConfig([...defaultConfig]);
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
@@ -49,8 +71,6 @@ These are the currently available config templates.
49
71
 
50
72
  ## Versioning
51
73
 
52
- _Until v1.0.0 is released, breaking changes may be introduced in minor releases without prior warnings._
53
-
54
74
  The package follows the following versioning scheme: `X.Y.Z`.
55
75
 
56
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,123 @@
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
+ //# 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"}
package/dist/base.js ADDED
@@ -0,0 +1,128 @@
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
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"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"}
package/dist/next.d.ts ADDED
@@ -0,0 +1,16 @@
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
+ //# sourceMappingURL=next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,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"}
package/dist/next.js ADDED
@@ -0,0 +1,61 @@
1
+ import { defineConfig } from 'oxlint';
2
+ import { reactConfig } from './react.js';
3
+ import reactRefresh from 'eslint-plugin-react-refresh';
4
+ const DEFAULT_OPTIONS = { uiPath: 'src/components/ui/' };
5
+ function nextConfig(options) {
6
+ const opts = { ...DEFAULT_OPTIONS, ...options };
7
+ return defineConfig({
8
+ extends: [reactConfig(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
+ export { defineConfig, nextConfig };
61
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAqB,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAcvD,MAAM,eAAe,GAAgB,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC;AAEtE,SAAS,UAAU,CAAC,OAA8B;IAChD,MAAM,IAAI,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC;IAEhD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,KAAK,EAAE;YACL,gCAAgC,EAAE,MAAM;YACxC,mCAAmC,EAAE,MAAM;YAC3C,+BAA+B,EAAE,MAAM;YACvC,sCAAsC,EAAE,MAAM;YAC9C,0DAA0D,EAAE,MAAM;YAClE,wBAAwB,EAAE,MAAM;YAChC,4BAA4B,EAAE,MAAM;YACpC,mCAAmC,EAAE,OAAO;YAC5C,gCAAgC,EAAE,MAAM;YACxC,sCAAsC,EAAE,MAAM;YAC9C,4BAA4B,EAAE,OAAO;YACrC,sCAAsC,EAAE,MAAM;YAC9C,qBAAqB,EAAE,MAAM;YAC7B,mCAAmC,EAAE,MAAM;YAC3C,6BAA6B,EAAE,OAAO;YACtC,sCAAsC,EAAE,OAAO;YAC/C,uCAAuC,EAAE,OAAO;YAChD,8BAA8B,EAAE,OAAO;YACvC,uCAAuC,EAAE,OAAO;YAChD,wCAAwC,EAAE,OAAO;SAClD;QACD,cAAc,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,CAAC;QACnE,SAAS,EAAE;YACT,gEAAgE;YAChE,4FAA4F;YAC5F;gBACE,KAAK,EAAE,CAAC,kCAAkC,CAAC;gBAC3C,KAAK,EAAE;oBACL,yCAAyC,EAAE;wBACzC,OAAO;wBACP;4BACE,gBAAgB,EAAG,YAAY,CAAC,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;AAED,OAAO,EAAqB,YAAY,EAAE,UAAU,EAAE,CAAC"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,128 @@
1
+ import { defineConfig, type OxlintConfig } from 'oxlint';
2
+ type NodeOptions = {};
3
+ declare function nodeConfig(_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-unexpected-multiline': "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
+ env: {
124
+ node: true;
125
+ };
126
+ };
127
+ export { type OxlintConfig, defineConfig, nodeConfig };
128
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,KAAK,WAAW,GAAG,EAAE,CAAC;AAItB,iBAAS,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASlD;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC"}
package/dist/node.js ADDED
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'oxlint';
2
+ import { baseConfig } from './base.js';
3
+ // const DEFAULT_OPTIONS: NodeOptions = {};
4
+ function nodeConfig(_options) {
5
+ // const opts = { ...DEFAULT_OPTIONS, ...options };
6
+ return defineConfig({
7
+ extends: [baseConfig()],
8
+ env: {
9
+ node: true,
10
+ },
11
+ });
12
+ }
13
+ export { defineConfig, nodeConfig };
14
+ //# 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,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIvC,2CAA2C;AAE3C,SAAS,UAAU,CAAC,QAA+B;IACjD,mDAAmD;IAEnD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC;QACvB,GAAG,EAAE;YACH,IAAI,EAAE,IAAI;SACX;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAqB,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,184 @@
1
+ import { defineConfig, type OxlintConfig } from 'oxlint';
2
+ export type ReactOptions = {};
3
+ declare function reactConfig(_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-unexpected-multiline': "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
+ plugins: "react"[];
124
+ jsPlugins: {
125
+ name: string;
126
+ specifier: string;
127
+ }[];
128
+ rules: {
129
+ 'react-hooks-js/rules-of-hooks': "error";
130
+ 'react-hooks-js/exhaustive-deps': "warn";
131
+ 'react-hooks-js/set-state-in-effect': "warn";
132
+ 'react-refresh-js/only-export-components': "error";
133
+ 'react-compiler-js/react-compiler': "error";
134
+ };
135
+ overrides: {
136
+ files: string[];
137
+ rules: {
138
+ 'react/display-name': "error";
139
+ 'react/jsx-key': "error";
140
+ 'react/jsx-no-comment-textnodes': "error";
141
+ 'react/jsx-no-duplicate-props': "error";
142
+ 'react/jsx-no-target-blank': "off";
143
+ 'react/jsx-no-undef': "error";
144
+ 'react/no-children-prop': "error";
145
+ 'react/no-danger-with-children': "error";
146
+ 'react/no-direct-mutation-state': "error";
147
+ 'react/no-find-dom-node': "error";
148
+ 'react/no-is-mounted': "error";
149
+ 'react/no-render-return-value': "error";
150
+ 'react/no-string-refs': "error";
151
+ 'react/no-unescaped-entities': "error";
152
+ 'react/no-unknown-property': "off";
153
+ 'react/no-unsafe': "off";
154
+ 'react/react-in-jsx-scope': "off";
155
+ 'react/require-render-return': "error";
156
+ 'import/no-anonymous-default-export': "warn";
157
+ 'jsx-a11y/alt-text': (string | {
158
+ elements: string[];
159
+ img: string[];
160
+ })[];
161
+ 'jsx-a11y/aria-props': "warn";
162
+ 'jsx-a11y/aria-proptypes': "warn";
163
+ 'jsx-a11y/aria-unsupported-elements': "warn";
164
+ 'jsx-a11y/role-has-required-aria-props': "warn";
165
+ 'jsx-a11y/role-supports-aria-props': "warn";
166
+ };
167
+ globals: {
168
+ AudioWorkletGlobalScope: "readonly";
169
+ AudioWorkletProcessor: "readonly";
170
+ currentFrame: "readonly";
171
+ currentTime: "readonly";
172
+ registerProcessor: "readonly";
173
+ sampleRate: "readonly";
174
+ WorkletGlobalScope: "readonly";
175
+ };
176
+ plugins: ("import" | "jsx-a11y")[];
177
+ env: {
178
+ browser: true;
179
+ node: true;
180
+ };
181
+ }[];
182
+ };
183
+ export { type OxlintConfig, defineConfig, reactConfig };
184
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGzD,MAAM,MAAM,YAAY,GAAG,EAAE,CAAC;AAI9B,iBAAS,WAAW,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEpD;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC"}
package/dist/react.js ADDED
@@ -0,0 +1,71 @@
1
+ import { defineConfig } from 'oxlint';
2
+ import { baseConfig } from './base.js';
3
+ // const DEFAULT_OPTIONS: ReactOptions = {};
4
+ function reactConfig(_options) {
5
+ // const opts = { ...DEFAULT_OPTIONS, ...options };
6
+ return defineConfig({
7
+ extends: [baseConfig()],
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
+ export { defineConfig, reactConfig };
71
+ //# 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,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIvC,4CAA4C;AAE5C,SAAS,WAAW,CAAC,QAAgC;IACnD,mDAAmD;IAEnD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC;QACvB,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;YAClD,kCAAkC,EAAE,OAAO;SAC5C;QACD,SAAS,EAAE;YACT;gBACE,KAAK,EAAE,CAAC,kCAAkC,CAAC;gBAC3C,KAAK,EAAE;oBACL,oBAAoB,EAAE,OAAO;oBAC7B,eAAe,EAAE,OAAO;oBACxB,gCAAgC,EAAE,OAAO;oBACzC,8BAA8B,EAAE,OAAO;oBACvC,2BAA2B,EAAE,KAAK;oBAClC,oBAAoB,EAAE,OAAO;oBAC7B,wBAAwB,EAAE,OAAO;oBACjC,+BAA+B,EAAE,OAAO;oBACxC,mEAAmE;oBACnE,gCAAgC,EAAE,OAAO;oBACzC,wBAAwB,EAAE,OAAO;oBACjC,qBAAqB,EAAE,OAAO;oBAC9B,8BAA8B,EAAE,OAAO;oBACvC,sBAAsB,EAAE,OAAO;oBAC/B,6BAA6B,EAAE,OAAO;oBACtC,2BAA2B,EAAE,KAAK;oBAClC,iBAAiB,EAAE,KAAK;oBACxB,0BAA0B,EAAE,KAAK;oBACjC,6BAA6B,EAAE,OAAO;oBACtC,oCAAoC,EAAE,MAAM;oBAC5C,mBAAmB,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;oBACpE,qBAAqB,EAAE,MAAM;oBAC7B,yBAAyB,EAAE,MAAM;oBACjC,oCAAoC,EAAE,MAAM;oBAC5C,uCAAuC,EAAE,MAAM;oBAC/C,mCAAmC,EAAE,MAAM;iBAC5C;gBACD,OAAO,EAAE;oBACP,uBAAuB,EAAE,UAAU;oBACnC,qBAAqB,EAAE,UAAU;oBACjC,YAAY,EAAE,UAAU;oBACxB,WAAW,EAAE,UAAU;oBACvB,iBAAiB,EAAE,UAAU;oBAC7B,UAAU,EAAE,UAAU;oBACtB,kBAAkB,EAAE,UAAU;iBAC/B;gBACD,OAAO,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;gBAC/B,GAAG,EAAE;oBACH,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,IAAI;iBACX;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAqB,YAAY,EAAE,WAAW,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,18 +1,23 @@
1
1
  {
2
2
  "name": "@4mbl/lint",
3
- "version": "0.0.0-beta.b5d5914",
3
+ "version": "0.0.0-beta.ba4500a",
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",
11
- "./node": "./src/node.ts",
12
- "./react": "./src/react.ts"
10
+ "./*": {
11
+ "types": "./dist/*.d.ts",
12
+ "development": "./src/*.ts",
13
+ "default": "./dist/*.js"
14
+ }
15
+ },
16
+ "bin": {
17
+ "lint": "./bin/cli.js"
13
18
  },
14
19
  "files": [
15
- "src",
20
+ "dist",
16
21
  "package.json",
17
22
  "README.md",
18
23
  "CHANGELOG.md"
@@ -26,16 +31,18 @@
26
31
  "lint"
27
32
  ],
28
33
  "dependencies": {
29
- "@eslint/js": "^10.0.1",
30
- "eslint": "^9.39.2",
31
- "eslint-config-next": "^16.1.6",
32
- "eslint-config-prettier": "^10.1.8",
33
34
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
34
35
  "eslint-plugin-react-hooks": "^7.0.1",
35
- "eslint-plugin-react-refresh": "^0.5.0",
36
- "globals": "^17.3.0",
36
+ "eslint-plugin-react-refresh": "^0.5.2",
37
+ "globals": "^17.4.0",
37
38
  "jiti": "^2.6.1",
38
- "typescript-eslint": "^8.55.0"
39
+ "oxlint": "^1.56.0",
40
+ "oxlint-tsgolint": "^0.17.0"
41
+ },
42
+ "devDependencies": {
43
+ "@4mbl/tsconfig": "0.0.0-beta.ba4500a"
39
44
  },
40
- "scripts": {}
45
+ "scripts": {
46
+ "build": "tsc"
47
+ }
41
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 { type Config, defineConfig, globalIgnores } from 'eslint/config';
9
- import tseslint from 'typescript-eslint';
10
-
11
- export { type Config, defineConfig };
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/node.ts DELETED
@@ -1,14 +0,0 @@
1
- import js from '@eslint/js';
2
- import { defineConfig, globalIgnores, type Config } from 'eslint/config';
3
- import globals from 'globals';
4
- import tseslint from 'typescript-eslint';
5
-
6
- export { type Config, defineConfig };
7
-
8
- export default defineConfig([
9
- globalIgnores(['dist/**']),
10
- { files: ['**/*.{js,mjs,cjs,ts}'] },
11
- { languageOptions: { globals: globals.node } },
12
- js.configs.recommended,
13
- ...tseslint.configs.recommended,
14
- ]) satisfies Config[];
package/src/react.ts DELETED
@@ -1,34 +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, type Config } from 'eslint/config';
6
- import globals from 'globals';
7
- import tseslint from 'typescript-eslint';
8
-
9
- export { type Config, defineConfig };
10
-
11
- export default defineConfig([
12
- js.configs.recommended,
13
- tseslint.configs.recommended,
14
-
15
- reactHooks.configs.flat.recommended,
16
- reactRefresh.configs.recommended,
17
-
18
- globalIgnores(['dist']),
19
- {
20
- files: ['**/*.{ts,tsx}'],
21
- languageOptions: {
22
- ecmaVersion: 2020,
23
- globals: globals.browser,
24
- },
25
- rules: {
26
- 'react-refresh/only-export-components': [
27
- 'warn',
28
- { allowConstantExport: true },
29
- ],
30
- },
31
- },
32
-
33
- prettier,
34
- ]) satisfies Config[];