@wistia/oxlint-config 0.3.0 → 0.3.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/configs/{javascript.ts → javascript.mjs} +3 -3
- package/configs/{node.ts → node.mjs} +1 -1
- package/configs/{playwright.ts → playwright.mjs} +1 -1
- package/configs/{react.ts → react.mjs} +2 -2
- package/configs/{storybook.ts → storybook.mjs} +1 -1
- package/configs/{styled-components.ts → styled-components.mjs} +1 -1
- package/configs/{testing-library.ts → testing-library.mjs} +1 -1
- package/configs/{typescript.ts → typescript.mjs} +4 -4
- package/configs/{vitest.ts → vitest.mjs} +1 -1
- package/index.d.mts +32 -0
- package/index.mjs +24 -0
- package/package.json +14 -13
- package/rules/{base.ts → base.mjs} +1 -3
- package/rules/{import.ts → import.mjs} +1 -3
- package/rules/{node.ts → node.mjs} +1 -3
- package/rules/{playwright.ts → playwright.mjs} +1 -3
- package/rules/{promise.ts → promise.mjs} +1 -3
- package/rules/{react-a11y.ts → react-a11y.mjs} +1 -3
- package/rules/{react.ts → react.mjs} +1 -3
- package/rules/{storybook.ts → storybook.mjs} +1 -3
- package/rules/{styled-components.ts → styled-components.mjs} +1 -3
- package/rules/{testing-library.ts → testing-library.mjs} +1 -3
- package/rules/{typescript.ts → typescript.mjs} +1 -3
- package/rules/{vitest.ts → vitest.mjs} +1 -3
- package/index.ts +0 -27
- package/types.ts +0 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineConfig } from 'oxlint';
|
|
2
|
-
import { baseRules } from '../rules/base.
|
|
3
|
-
import { importRules } from '../rules/import.
|
|
4
|
-
import { promiseRules } from '../rules/promise.
|
|
2
|
+
import { baseRules } from '../rules/base.mjs';
|
|
3
|
+
import { importRules } from '../rules/import.mjs';
|
|
4
|
+
import { promiseRules } from '../rules/promise.mjs';
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
7
|
plugins: [...baseRules.plugins, ...importRules.plugins, ...promiseRules.plugins],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineConfig } from 'oxlint';
|
|
2
|
-
import { reactRules } from '../rules/react.
|
|
3
|
-
import { reactA11yRules } from '../rules/react-a11y.
|
|
2
|
+
import { reactRules } from '../rules/react.mjs';
|
|
3
|
+
import { reactA11yRules } from '../rules/react-a11y.mjs';
|
|
4
4
|
|
|
5
5
|
export default defineConfig({
|
|
6
6
|
plugins: [...reactRules.plugins, ...reactA11yRules.plugins],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from 'oxlint';
|
|
2
|
-
import { baseRules } from '../rules/base.
|
|
3
|
-
import { importRules } from '../rules/import.
|
|
4
|
-
import { promiseRules } from '../rules/promise.
|
|
5
|
-
import { typescriptRules } from '../rules/typescript.
|
|
2
|
+
import { baseRules } from '../rules/base.mjs';
|
|
3
|
+
import { importRules } from '../rules/import.mjs';
|
|
4
|
+
import { promiseRules } from '../rules/promise.mjs';
|
|
5
|
+
import { typescriptRules } from '../rules/typescript.mjs';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
plugins: [
|
package/index.d.mts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DummyRule, ExternalPluginEntry, OxlintConfig } from 'oxlint';
|
|
2
|
+
|
|
3
|
+
export type RuleFile = {
|
|
4
|
+
plugins?: string[];
|
|
5
|
+
jsPlugins?: ExternalPluginEntry[];
|
|
6
|
+
rules: Record<string, DummyRule>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// Rules
|
|
10
|
+
export declare const baseRules: RuleFile;
|
|
11
|
+
export declare const importRules: RuleFile;
|
|
12
|
+
export declare const promiseRules: RuleFile;
|
|
13
|
+
export declare const typescriptRules: RuleFile;
|
|
14
|
+
export declare const reactRules: RuleFile;
|
|
15
|
+
export declare const reactA11yRules: RuleFile;
|
|
16
|
+
export declare const nodeRules: RuleFile;
|
|
17
|
+
export declare const vitestRules: RuleFile;
|
|
18
|
+
export declare const playwrightRules: RuleFile;
|
|
19
|
+
export declare const storybookRules: RuleFile;
|
|
20
|
+
export declare const styledComponentsRules: RuleFile;
|
|
21
|
+
export declare const testingLibraryRules: RuleFile;
|
|
22
|
+
|
|
23
|
+
// Configs
|
|
24
|
+
export declare const javascriptConfig: OxlintConfig;
|
|
25
|
+
export declare const typescriptConfig: OxlintConfig;
|
|
26
|
+
export declare const reactConfig: OxlintConfig;
|
|
27
|
+
export declare const nodeConfig: OxlintConfig;
|
|
28
|
+
export declare const vitestConfig: OxlintConfig;
|
|
29
|
+
export declare const playwrightConfig: OxlintConfig;
|
|
30
|
+
export declare const storybookConfig: OxlintConfig;
|
|
31
|
+
export declare const styledComponentsConfig: OxlintConfig;
|
|
32
|
+
export declare const testingLibraryConfig: OxlintConfig;
|
package/index.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Rules
|
|
2
|
+
export { baseRules } from './rules/base.mjs';
|
|
3
|
+
export { importRules } from './rules/import.mjs';
|
|
4
|
+
export { promiseRules } from './rules/promise.mjs';
|
|
5
|
+
export { typescriptRules } from './rules/typescript.mjs';
|
|
6
|
+
export { reactRules } from './rules/react.mjs';
|
|
7
|
+
export { reactA11yRules } from './rules/react-a11y.mjs';
|
|
8
|
+
export { nodeRules } from './rules/node.mjs';
|
|
9
|
+
export { vitestRules } from './rules/vitest.mjs';
|
|
10
|
+
export { playwrightRules } from './rules/playwright.mjs';
|
|
11
|
+
export { storybookRules } from './rules/storybook.mjs';
|
|
12
|
+
export { styledComponentsRules } from './rules/styled-components.mjs';
|
|
13
|
+
export { testingLibraryRules } from './rules/testing-library.mjs';
|
|
14
|
+
|
|
15
|
+
// Configs
|
|
16
|
+
export { default as javascriptConfig } from './configs/javascript.mjs';
|
|
17
|
+
export { default as typescriptConfig } from './configs/typescript.mjs';
|
|
18
|
+
export { default as reactConfig } from './configs/react.mjs';
|
|
19
|
+
export { default as nodeConfig } from './configs/node.mjs';
|
|
20
|
+
export { default as vitestConfig } from './configs/vitest.mjs';
|
|
21
|
+
export { default as playwrightConfig } from './configs/playwright.mjs';
|
|
22
|
+
export { default as storybookConfig } from './configs/storybook.mjs';
|
|
23
|
+
export { default as styledComponentsConfig } from './configs/styled-components.mjs';
|
|
24
|
+
export { default as testingLibraryConfig } from './configs/testing-library.mjs';
|
package/package.json
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistia/oxlint-config",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Wistia's Oxlint configurations",
|
|
5
5
|
"packageManager": "yarn@4.13.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"configs",
|
|
9
9
|
"rules",
|
|
10
|
-
"index.
|
|
11
|
-
"
|
|
10
|
+
"index.mjs",
|
|
11
|
+
"index.d.mts"
|
|
12
12
|
],
|
|
13
13
|
"exports": {
|
|
14
14
|
"./package.json": "./package.json",
|
|
15
15
|
"./configs/*": "./configs/*",
|
|
16
16
|
"./rules/*": "./rules/*",
|
|
17
|
-
".":
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"./
|
|
22
|
-
"./
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./index.d.mts",
|
|
19
|
+
"default": "./index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./javascript": "./configs/javascript.mjs",
|
|
22
|
+
"./typescript": "./configs/typescript.mjs",
|
|
23
|
+
"./react": "./configs/react.mjs",
|
|
24
|
+
"./node": "./configs/node.mjs",
|
|
25
|
+
"./vitest": "./configs/vitest.mjs"
|
|
23
26
|
},
|
|
24
27
|
"scripts": {
|
|
25
28
|
"changeset": "changeset",
|
|
@@ -27,9 +30,8 @@
|
|
|
27
30
|
"format:ci": "oxfmt --check .",
|
|
28
31
|
"outdated": "yarn upgrade-interactive",
|
|
29
32
|
"release": "changeset publish",
|
|
30
|
-
"test": "vitest run --exclude test/validate-configs.test.
|
|
31
|
-
"
|
|
32
|
-
"validate": "vitest run test/validate-configs.test.mts"
|
|
33
|
+
"test": "vitest run --exclude test/validate-configs.test.mjs",
|
|
34
|
+
"validate": "vitest run test/validate-configs.test.mjs"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
37
|
"oxlint": ">= 1.0.0"
|
|
@@ -52,7 +54,6 @@
|
|
|
52
54
|
"oxfmt": "^0.43.0",
|
|
53
55
|
"oxlint": "^1.58.0",
|
|
54
56
|
"storybook": "^10.3.4",
|
|
55
|
-
"typescript": "^6.0.2",
|
|
56
57
|
"vitest": "^4.1.2"
|
|
57
58
|
},
|
|
58
59
|
"engines": {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
export const baseRules = {
|
|
4
2
|
plugins: ['eslint', 'oxc'],
|
|
5
3
|
rules: {
|
|
@@ -630,4 +628,4 @@ export const baseRules = {
|
|
|
630
628
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/uninvoked-array-callback.html
|
|
631
629
|
'oxc/uninvoked-array-callback': 'error',
|
|
632
630
|
},
|
|
633
|
-
}
|
|
631
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
export const importRules = {
|
|
4
2
|
plugins: ['import'],
|
|
5
3
|
rules: {
|
|
@@ -86,4 +84,4 @@ export const importRules = {
|
|
|
86
84
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
87
85
|
'import/no-webpack-loader-syntax': 'error',
|
|
88
86
|
},
|
|
89
|
-
}
|
|
87
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
// Native oxlint node rules + eslint-plugin-n via jsPlugins for rules
|
|
4
2
|
// without native equivalents.
|
|
5
3
|
export const nodeRules = {
|
|
@@ -130,4 +128,4 @@ export const nodeRules = {
|
|
|
130
128
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-node-protocol.md
|
|
131
129
|
'n/prefer-node-protocol': 'error',
|
|
132
130
|
},
|
|
133
|
-
}
|
|
131
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
// All playwright rules loaded via jsPlugins (no native oxlint support).
|
|
4
2
|
export const playwrightRules = {
|
|
5
3
|
jsPlugins: ['eslint-plugin-playwright'],
|
|
@@ -192,4 +190,4 @@ export const playwrightRules = {
|
|
|
192
190
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/require-to-throw-message.md
|
|
193
191
|
'eslint-plugin-playwright/require-to-throw-message': 'error',
|
|
194
192
|
},
|
|
195
|
-
}
|
|
193
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
export const promiseRules = {
|
|
4
2
|
plugins: ['promise'],
|
|
5
3
|
rules: {
|
|
@@ -67,4 +65,4 @@ export const promiseRules = {
|
|
|
67
65
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/spec-only.md
|
|
68
66
|
'promise/spec-only': 'error',
|
|
69
67
|
},
|
|
70
|
-
}
|
|
68
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
export const reactA11yRules = {
|
|
4
2
|
plugins: ['jsx-a11y'],
|
|
5
3
|
rules: {
|
|
@@ -150,4 +148,4 @@ export const reactA11yRules = {
|
|
|
150
148
|
// decision: left to implementer
|
|
151
149
|
'jsx_a11y/prefer-tag-over-role': 'off',
|
|
152
150
|
},
|
|
153
|
-
}
|
|
151
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
export const reactRules = {
|
|
4
2
|
plugins: ['react'],
|
|
5
3
|
rules: {
|
|
@@ -235,4 +233,4 @@ export const reactRules = {
|
|
|
235
233
|
// decision: stylistic choice best left for formatter
|
|
236
234
|
'react/jsx-handler-names': 'off',
|
|
237
235
|
},
|
|
238
|
-
}
|
|
236
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
// All storybook rules loaded via jsPlugins (no native oxlint support).
|
|
4
2
|
export const storybookRules = {
|
|
5
3
|
jsPlugins: ['eslint-plugin-storybook'],
|
|
@@ -64,4 +62,4 @@ export const storybookRules = {
|
|
|
64
62
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/use-storybook-testing-library.md
|
|
65
63
|
'eslint-plugin-storybook/use-storybook-testing-library': 'error',
|
|
66
64
|
},
|
|
67
|
-
}
|
|
65
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
// All styled-components-a11y rules loaded via jsPlugins (no native oxlint support).
|
|
4
2
|
export const styledComponentsRules = {
|
|
5
3
|
jsPlugins: ['eslint-plugin-styled-components-a11y'],
|
|
@@ -150,4 +148,4 @@ export const styledComponentsRules = {
|
|
|
150
148
|
// Enforce tabIndex value is not greater than zero
|
|
151
149
|
'eslint-plugin-styled-components-a11y/tabindex-no-positive': 'error',
|
|
152
150
|
},
|
|
153
|
-
}
|
|
151
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
// All testing-library + jest-dom rules loaded via jsPlugins (no native oxlint support).
|
|
4
2
|
export const testingLibraryRules = {
|
|
5
3
|
jsPlugins: ['eslint-plugin-testing-library', 'eslint-plugin-jest-dom'],
|
|
@@ -170,4 +168,4 @@ export const testingLibraryRules = {
|
|
|
170
168
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-value.md
|
|
171
169
|
'eslint-plugin-jest-dom/prefer-to-have-value': 'error',
|
|
172
170
|
},
|
|
173
|
-
}
|
|
171
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
export const typescriptRules = {
|
|
4
2
|
plugins: ['typescript'],
|
|
5
3
|
rules: {
|
|
@@ -454,4 +452,4 @@ export const typescriptRules = {
|
|
|
454
452
|
// https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
|
|
455
453
|
'typescript/use-unknown-in-catch-callback-variable': 'error',
|
|
456
454
|
},
|
|
457
|
-
}
|
|
455
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { RuleFile } from '../types.ts';
|
|
2
|
-
|
|
3
1
|
// NOTE: oxlint splits vitest-related rules across two plugin namespaces:
|
|
4
2
|
// - "vitest/" for rules that are vitest-specific (no Jest equivalent)
|
|
5
3
|
// - "jest/" for rules that originated in eslint-plugin-jest and are shared with vitest
|
|
@@ -321,4 +319,4 @@ export const vitestRules = {
|
|
|
321
319
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
|
|
322
320
|
'vitest-js/padding-around-describe-blocks': 'error',
|
|
323
321
|
},
|
|
324
|
-
}
|
|
322
|
+
};
|
package/index.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Types
|
|
2
|
-
export type { RuleFile } from './types.ts';
|
|
3
|
-
|
|
4
|
-
// Rules
|
|
5
|
-
export { baseRules } from './rules/base.ts';
|
|
6
|
-
export { importRules } from './rules/import.ts';
|
|
7
|
-
export { promiseRules } from './rules/promise.ts';
|
|
8
|
-
export { typescriptRules } from './rules/typescript.ts';
|
|
9
|
-
export { reactRules } from './rules/react.ts';
|
|
10
|
-
export { reactA11yRules } from './rules/react-a11y.ts';
|
|
11
|
-
export { nodeRules } from './rules/node.ts';
|
|
12
|
-
export { vitestRules } from './rules/vitest.ts';
|
|
13
|
-
export { playwrightRules } from './rules/playwright.ts';
|
|
14
|
-
export { storybookRules } from './rules/storybook.ts';
|
|
15
|
-
export { styledComponentsRules } from './rules/styled-components.ts';
|
|
16
|
-
export { testingLibraryRules } from './rules/testing-library.ts';
|
|
17
|
-
|
|
18
|
-
// Configs
|
|
19
|
-
export { default as javascriptConfig } from './configs/javascript.ts';
|
|
20
|
-
export { default as typescriptConfig } from './configs/typescript.ts';
|
|
21
|
-
export { default as reactConfig } from './configs/react.ts';
|
|
22
|
-
export { default as nodeConfig } from './configs/node.ts';
|
|
23
|
-
export { default as vitestConfig } from './configs/vitest.ts';
|
|
24
|
-
export { default as playwrightConfig } from './configs/playwright.ts';
|
|
25
|
-
export { default as storybookConfig } from './configs/storybook.ts';
|
|
26
|
-
export { default as styledComponentsConfig } from './configs/styled-components.ts';
|
|
27
|
-
export { default as testingLibraryConfig } from './configs/testing-library.ts';
|
package/types.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { DummyRule, ExternalPluginEntry } from 'oxlint';
|
|
2
|
-
|
|
3
|
-
type LintPlugin =
|
|
4
|
-
| 'eslint'
|
|
5
|
-
| 'import'
|
|
6
|
-
| 'jest'
|
|
7
|
-
| 'jsdoc'
|
|
8
|
-
| 'jsx-a11y'
|
|
9
|
-
| 'nextjs'
|
|
10
|
-
| 'node'
|
|
11
|
-
| 'oxc'
|
|
12
|
-
| 'promise'
|
|
13
|
-
| 'react'
|
|
14
|
-
| 'react-perf'
|
|
15
|
-
| 'typescript'
|
|
16
|
-
| 'unicorn'
|
|
17
|
-
| 'vitest'
|
|
18
|
-
| 'vue';
|
|
19
|
-
|
|
20
|
-
export type RuleFile = {
|
|
21
|
-
plugins?: LintPlugin[];
|
|
22
|
-
jsPlugins?: ExternalPluginEntry[];
|
|
23
|
-
rules: Record<string, DummyRule>;
|
|
24
|
-
};
|