@4mbl/lint 1.0.0-beta.1 → 1.0.0-beta.2

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,16 @@
1
1
  # @4mbl/lint
2
2
 
3
+ ## 1.0.0-beta.2
4
+
5
+ ### Minor Changes
6
+
7
+ - ba4500a: Use named exports for config templates
8
+ - ba4500a: Re-export oxlint defineConfig
9
+
10
+ ### Patch Changes
11
+
12
+ - 2b77e08: fix(lint): transpile configs to support usage from node_modules
13
+
3
14
  ## 1.0.0-beta.1
4
15
 
5
16
  ### Patch Changes
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":"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,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,gBAAgB,EAAE,OAAO;YACzB,iBAAiB,EAAE,OAAO;YAC1B,+BAA+B,EAAE,OAAO;YACxC,uBAAuB,EAAE,OAAO;YAChC,kBAAkB,EAAE,OAAO;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,YAAY,EAAE,UAAU,EAAE,CAAC"}
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":"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AAO;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,WAA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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,21 +1,23 @@
1
1
  {
2
2
  "name": "@4mbl/lint",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
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
+ }
13
15
  },
14
16
  "bin": {
15
17
  "lint": "./bin/cli.js"
16
18
  },
17
19
  "files": [
18
- "src",
20
+ "dist",
19
21
  "package.json",
20
22
  "README.md",
21
23
  "CHANGELOG.md"
@@ -41,6 +43,6 @@
41
43
  "@4mbl/tsconfig": "4.4.0"
42
44
  },
43
45
  "scripts": {
44
- "build": "tsc --noEmit"
46
+ "build": "tsc"
45
47
  }
46
48
  }
package/src/base.ts DELETED
@@ -1,134 +0,0 @@
1
- import { defineConfig, type OxlintConfig } from 'oxlint';
2
-
3
- type BaseOptions = {
4
- uiPath: string;
5
- };
6
-
7
- // const DEFAULT_OPTIONS: BaseOptions = {};
8
-
9
- export default function (_options?: Partial<BaseOptions>) {
10
- // const opts = { ...DEFAULT_OPTIONS, ...options };
11
-
12
- return defineConfig({
13
- plugins: ['typescript', 'unicorn'],
14
- jsPlugins: [],
15
- categories: {
16
- correctness: 'off',
17
- },
18
- env: {
19
- builtin: true,
20
- },
21
- options: {
22
- typeAware: true,
23
- },
24
- rules: {
25
- 'constructor-super': 'error',
26
- 'for-direction': 'error',
27
- 'getter-return': 'error',
28
- 'no-async-promise-executor': 'error',
29
- 'no-case-declarations': 'error',
30
- 'no-class-assign': 'error',
31
- 'no-compare-neg-zero': 'error',
32
- 'no-cond-assign': 'error',
33
- 'no-const-assign': 'error',
34
- 'no-constant-binary-expression': 'error',
35
- 'no-constant-condition': 'error',
36
- 'no-control-regex': 'error',
37
- 'no-debugger': 'error',
38
- 'no-delete-var': 'error',
39
- 'no-dupe-class-members': 'error',
40
- 'no-dupe-else-if': 'error',
41
- 'no-dupe-keys': 'error',
42
- 'no-duplicate-case': 'error',
43
- 'no-empty': 'error',
44
- 'no-empty-character-class': 'error',
45
- 'no-empty-pattern': 'error',
46
- 'no-empty-static-block': 'error',
47
- 'no-ex-assign': 'error',
48
- 'no-extra-boolean-cast': 'error',
49
- 'no-fallthrough': 'error',
50
- 'no-func-assign': 'error',
51
- 'no-global-assign': 'error',
52
- 'no-import-assign': 'error',
53
- 'no-invalid-regexp': 'error',
54
- 'no-irregular-whitespace': 'error',
55
- 'no-loss-of-precision': 'error',
56
- 'no-misleading-character-class': 'error',
57
- 'no-new-native-nonconstructor': 'error',
58
- 'no-nonoctal-decimal-escape': 'error',
59
- 'no-obj-calls': 'error',
60
- 'no-prototype-builtins': 'error',
61
- 'no-redeclare': 'error',
62
- 'no-regex-spaces': 'error',
63
- 'no-self-assign': 'error',
64
- 'no-setter-return': 'error',
65
- 'no-shadow-restricted-names': 'error',
66
- 'no-sparse-arrays': 'error',
67
- 'no-this-before-super': 'error',
68
- 'no-undef': 'error',
69
- 'no-unreachable': 'error',
70
- 'no-unsafe-finally': 'error',
71
- 'no-unsafe-negation': 'error',
72
- 'no-unsafe-optional-chaining': 'error',
73
- 'no-unused-labels': 'error',
74
- 'no-unused-private-class-members': 'error',
75
- 'no-unused-vars': 'warn',
76
- 'no-useless-backreference': 'error',
77
- 'no-useless-catch': 'error',
78
- 'no-useless-escape': 'error',
79
- 'no-with': 'error',
80
- 'require-yield': 'error',
81
- 'use-isnan': 'error',
82
- 'valid-typeof': 'error',
83
- '@typescript-eslint/ban-ts-comment': 'error',
84
- 'no-array-constructor': 'error',
85
- '@typescript-eslint/no-duplicate-enum-values': 'error',
86
- '@typescript-eslint/no-empty-object-type': 'error',
87
- '@typescript-eslint/no-explicit-any': 'error',
88
- '@typescript-eslint/no-extra-non-null-assertion': 'error',
89
- '@typescript-eslint/no-misused-new': 'error',
90
- '@typescript-eslint/no-namespace': 'error',
91
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
92
- '@typescript-eslint/no-require-imports': 'error',
93
- '@typescript-eslint/no-this-alias': 'error',
94
- '@typescript-eslint/no-unnecessary-type-constraint': 'error',
95
- '@typescript-eslint/no-unsafe-declaration-merging': 'error',
96
- '@typescript-eslint/no-unsafe-function-type': 'error',
97
- 'no-unused-expressions': 'warn',
98
- '@typescript-eslint/no-wrapper-object-types': 'error',
99
- '@typescript-eslint/prefer-as-const': 'error',
100
- '@typescript-eslint/prefer-namespace-keyword': 'error',
101
- '@typescript-eslint/triple-slash-reference': 'error',
102
- },
103
- overrides: [
104
- {
105
- files: ['**/*.{ts,tsx,mts,cts}'],
106
- rules: {
107
- 'constructor-super': 'off',
108
- 'getter-return': 'off',
109
- 'no-class-assign': 'off',
110
- 'no-const-assign': 'off',
111
- 'no-dupe-class-members': 'off',
112
- 'no-dupe-keys': 'off',
113
- 'no-func-assign': 'off',
114
- 'no-import-assign': 'off',
115
- 'no-new-native-nonconstructor': 'off',
116
- 'no-obj-calls': 'off',
117
- 'no-redeclare': 'off',
118
- 'no-setter-return': 'off',
119
- 'no-this-before-super': 'off',
120
- 'no-undef': 'off',
121
- 'no-unreachable': 'off',
122
- 'no-unsafe-negation': 'off',
123
- 'no-var': 'error',
124
- 'no-with': 'off',
125
- 'prefer-const': 'error',
126
- 'prefer-rest-params': 'error',
127
- 'prefer-spread': 'error',
128
- },
129
- },
130
- ],
131
- });
132
- }
133
-
134
- export type { OxlintConfig };
package/src/next.ts DELETED
@@ -1,81 +0,0 @@
1
- import { defineConfig, type OxlintConfig } from 'oxlint';
2
- import react, { type ReactOptions } from './react.ts';
3
- import reactRefresh from 'eslint-plugin-react-refresh';
4
-
5
- type NextOptions = ReactOptions & {
6
- /**
7
- * Sets the parent directory of UI components to ignore them in react-refresh.
8
- * This allows multiple exports from the same file, which is common when using libraries like class-variance-authority.
9
- *
10
- * Set to `null` to disable react-refresh suppression for UI components.
11
- *
12
- * Defaults to `src/components/ui/`.
13
- */
14
- uiPath: string | null;
15
- };
16
-
17
- const DEFAULT_OPTIONS: NextOptions = { uiPath: 'src/components/ui/' };
18
-
19
- export default function (options?: Partial<NextOptions>) {
20
- const opts = { ...DEFAULT_OPTIONS, ...options };
21
-
22
- return defineConfig({
23
- extends: [react(options)],
24
- plugins: ['nextjs'],
25
- rules: {
26
- '@next/next/google-font-display': 'warn',
27
- '@next/next/google-font-preconnect': 'warn',
28
- '@next/next/next-script-for-ga': 'warn',
29
- '@next/next/no-async-client-component': 'warn',
30
- '@next/next/no-before-interactive-script-outside-document': 'warn',
31
- '@next/next/no-css-tags': 'warn',
32
- '@next/next/no-head-element': 'warn',
33
- '@next/next/no-html-link-for-pages': 'error',
34
- '@next/next/no-page-custom-font': 'warn',
35
- '@next/next/no-styled-jsx-in-document': 'warn',
36
- '@next/next/no-sync-scripts': 'error',
37
- '@next/next/no-title-in-document-head': 'warn',
38
- '@next/next/no-typos': 'warn',
39
- '@next/next/no-unwanted-polyfillio': 'warn',
40
- '@next/next/inline-script-id': 'error',
41
- '@next/next/no-assign-module-variable': 'error',
42
- '@next/next/no-document-import-in-page': 'error',
43
- '@next/next/no-duplicate-head': 'error',
44
- '@next/next/no-head-import-in-document': 'error',
45
- '@next/next/no-script-component-in-head': 'error',
46
- },
47
- ignorePatterns: ['.next/**', 'out/**', 'build/**', 'next-env.d.ts'],
48
- overrides: [
49
- // ignores warnings for special exports in page and layout files
50
- // https://github.com/ArnaudBarre/eslint-plugin-react-refresh?tab=readme-ov-file#next-config
51
- {
52
- files: ['**/*.{js,jsx,mjs,ts,tsx,mts,cts}'],
53
- rules: {
54
- 'react-refresh-js/only-export-components': [
55
- 'error',
56
- {
57
- allowExportNames: (reactRefresh.configs.next.rules as any)[
58
- 'react-refresh/only-export-components'
59
- ][1]['allowExportNames'],
60
- },
61
- ],
62
- },
63
- },
64
- opts.uiPath === null
65
- ? { files: [], rules: {} }
66
- : {
67
- files: [
68
- `${opts.uiPath}/**/*.{js,jsx,mjs,ts,tsx,mts,cts}`.replaceAll(
69
- '//',
70
- '/',
71
- ),
72
- ],
73
- rules: {
74
- 'react-refresh-js/only-export-components': 'off',
75
- },
76
- },
77
- ],
78
- });
79
- }
80
-
81
- export type { OxlintConfig };
package/src/node.ts DELETED
@@ -1,15 +0,0 @@
1
- import { defineConfig, type OxlintConfig } from 'oxlint';
2
- import base from './base.ts';
3
-
4
- type NodeOptions = {};
5
-
6
- // const DEFAULT_OPTIONS: NodeOptions = {};
7
-
8
- export default function (_options?: Partial<NodeOptions>) {
9
- // const opts = { ...DEFAULT_OPTIONS, ...options };
10
- return defineConfig({
11
- extends: [base()],
12
- });
13
- }
14
-
15
- export type { OxlintConfig };
package/src/react.ts DELETED
@@ -1,76 +0,0 @@
1
- import { defineConfig, type OxlintConfig } from 'oxlint';
2
- import base from './base.ts';
3
-
4
- export type ReactOptions = {};
5
-
6
- // const DEFAULT_OPTIONS: ReactOptions = {};
7
-
8
- export default function (_options?: Partial<ReactOptions>) {
9
- // const opts = { ...DEFAULT_OPTIONS, ...options };
10
-
11
- return defineConfig({
12
- extends: [base()],
13
- plugins: ['react'],
14
- jsPlugins: [
15
- { name: 'react-hooks-js', specifier: 'eslint-plugin-react-hooks' },
16
- { name: 'react-refresh-js', specifier: 'eslint-plugin-react-refresh' },
17
- { name: 'react-compiler-js', specifier: 'eslint-plugin-react-compiler' },
18
- ],
19
- rules: {
20
- 'react-hooks-js/rules-of-hooks': 'error',
21
- 'react-hooks-js/exhaustive-deps': 'warn',
22
- 'react-hooks-js/set-state-in-effect': 'warn',
23
- 'react-refresh-js/only-export-components': 'error',
24
- 'react-compiler-js/react-compiler': 'error',
25
- },
26
- overrides: [
27
- {
28
- files: ['**/*.{js,jsx,mjs,ts,tsx,mts,cts}'],
29
- rules: {
30
- 'react/display-name': 'error',
31
- 'react/jsx-key': 'error',
32
- 'react/jsx-no-comment-textnodes': 'error',
33
- 'react/jsx-no-duplicate-props': 'error',
34
- 'react/jsx-no-target-blank': 'off',
35
- 'react/jsx-no-undef': 'error',
36
- 'react/no-children-prop': 'error',
37
- 'react/no-danger-with-children': 'error',
38
- // "react/no-deprecated": "error", // not implemented yet in oxlint
39
- 'react/no-direct-mutation-state': 'error',
40
- 'react/no-find-dom-node': 'error',
41
- 'react/no-is-mounted': 'error',
42
- 'react/no-render-return-value': 'error',
43
- 'react/no-string-refs': 'error',
44
- 'react/no-unescaped-entities': 'error',
45
- 'react/no-unknown-property': 'off',
46
- 'react/no-unsafe': 'off',
47
- 'react/react-in-jsx-scope': 'off',
48
- 'react/require-render-return': 'error',
49
- 'import/no-anonymous-default-export': 'warn',
50
- 'jsx-a11y/alt-text': ['warn', { elements: ['img'], img: ['Image'] }],
51
- 'jsx-a11y/aria-props': 'warn',
52
- 'jsx-a11y/aria-proptypes': 'warn',
53
- 'jsx-a11y/aria-unsupported-elements': 'warn',
54
- 'jsx-a11y/role-has-required-aria-props': 'warn',
55
- 'jsx-a11y/role-supports-aria-props': 'warn',
56
- },
57
- globals: {
58
- AudioWorkletGlobalScope: 'readonly',
59
- AudioWorkletProcessor: 'readonly',
60
- currentFrame: 'readonly',
61
- currentTime: 'readonly',
62
- registerProcessor: 'readonly',
63
- sampleRate: 'readonly',
64
- WorkletGlobalScope: 'readonly',
65
- },
66
- plugins: ['import', 'jsx-a11y'],
67
- env: {
68
- browser: true,
69
- node: true,
70
- },
71
- },
72
- ],
73
- });
74
- }
75
-
76
- export type { OxlintConfig };