@4mbl/lint 1.0.0-beta.1 → 1.0.0-beta.10
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 +69 -1
- package/README.md +80 -26
- package/bin/cli.js +56 -9
- package/dist/base.d.ts +321 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +176 -0
- package/dist/base.js.map +1 -0
- package/dist/next.d.ts +18 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +59 -0
- package/dist/next.js.map +1 -0
- package/dist/node.d.ts +331 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +15 -0
- package/dist/node.js.map +1 -0
- package/dist/react.d.ts +451 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +76 -0
- package/dist/react.js.map +1 -0
- package/package.json +14 -11
- package/src/base.ts +0 -134
- package/src/next.ts +0 -81
- package/src/node.ts +0 -15
- package/src/react.ts +0 -76
package/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 };
|