@4mbl/lint 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -1
- package/README.md +80 -26
- package/bin/cli.js +28 -9
- package/dist/base.d.ts +243 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +129 -0
- package/dist/base.js.map +1 -0
- package/dist/next.d.ts +18 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +64 -0
- package/dist/next.js.map +1 -0
- package/dist/node.d.ts +253 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +15 -0
- package/dist/node.js.map +1 -0
- package/dist/react.d.ts +365 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +72 -0
- package/dist/react.js.map +1 -0
- package/package.json +9 -6
- package/src/base.ts +0 -134
- package/src/next.ts +0 -81
- package/src/node.ts +0 -15
- package/src/react.ts +0 -76
package/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 };
|