@wistia/oxlint-config 0.3.3 → 0.3.4
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.mjs +9 -1
- package/configs/typescript.mjs +9 -1
- package/index.d.mts +2 -0
- package/index.mjs +2 -0
- package/package.json +3 -1
- package/rules/barrel-files.mjs +22 -0
- package/rules/filenames.mjs +18 -0
package/configs/javascript.mjs
CHANGED
|
@@ -2,13 +2,21 @@ import { defineConfig } from 'oxlint';
|
|
|
2
2
|
import { baseRules } from '../rules/base.mjs';
|
|
3
3
|
import { importRules } from '../rules/import.mjs';
|
|
4
4
|
import { promiseRules } from '../rules/promise.mjs';
|
|
5
|
+
import { filenamesRules } from '../rules/filenames.mjs';
|
|
6
|
+
import { barrelFilesRules } from '../rules/barrel-files.mjs';
|
|
5
7
|
|
|
6
8
|
export default defineConfig({
|
|
7
9
|
plugins: [...baseRules.plugins, ...importRules.plugins, ...promiseRules.plugins],
|
|
8
|
-
jsPlugins: [
|
|
10
|
+
jsPlugins: [
|
|
11
|
+
...(importRules.jsPlugins || []),
|
|
12
|
+
...(filenamesRules.jsPlugins || []),
|
|
13
|
+
...(barrelFilesRules.jsPlugins || []),
|
|
14
|
+
],
|
|
9
15
|
rules: {
|
|
10
16
|
...baseRules.rules,
|
|
11
17
|
...importRules.rules,
|
|
12
18
|
...promiseRules.rules,
|
|
19
|
+
...filenamesRules.rules,
|
|
20
|
+
...barrelFilesRules.rules,
|
|
13
21
|
},
|
|
14
22
|
});
|
package/configs/typescript.mjs
CHANGED
|
@@ -3,6 +3,8 @@ import { baseRules } from '../rules/base.mjs';
|
|
|
3
3
|
import { importRules } from '../rules/import.mjs';
|
|
4
4
|
import { promiseRules } from '../rules/promise.mjs';
|
|
5
5
|
import { typescriptRules } from '../rules/typescript.mjs';
|
|
6
|
+
import { filenamesRules } from '../rules/filenames.mjs';
|
|
7
|
+
import { barrelFilesRules } from '../rules/barrel-files.mjs';
|
|
6
8
|
|
|
7
9
|
export default defineConfig({
|
|
8
10
|
plugins: [
|
|
@@ -11,11 +13,17 @@ export default defineConfig({
|
|
|
11
13
|
...promiseRules.plugins,
|
|
12
14
|
...typescriptRules.plugins,
|
|
13
15
|
],
|
|
14
|
-
jsPlugins: [
|
|
16
|
+
jsPlugins: [
|
|
17
|
+
...(importRules.jsPlugins || []),
|
|
18
|
+
...(filenamesRules.jsPlugins || []),
|
|
19
|
+
...(barrelFilesRules.jsPlugins || []),
|
|
20
|
+
],
|
|
15
21
|
rules: {
|
|
16
22
|
...baseRules.rules,
|
|
17
23
|
...importRules.rules,
|
|
18
24
|
...promiseRules.rules,
|
|
19
25
|
...typescriptRules.rules,
|
|
26
|
+
...filenamesRules.rules,
|
|
27
|
+
...barrelFilesRules.rules,
|
|
20
28
|
},
|
|
21
29
|
});
|
package/index.d.mts
CHANGED
|
@@ -19,6 +19,8 @@ export declare const playwrightRules: RuleFile;
|
|
|
19
19
|
export declare const storybookRules: RuleFile;
|
|
20
20
|
export declare const styledComponentsRules: RuleFile;
|
|
21
21
|
export declare const testingLibraryRules: RuleFile;
|
|
22
|
+
export declare const filenamesRules: RuleFile;
|
|
23
|
+
export declare const barrelFilesRules: RuleFile;
|
|
22
24
|
|
|
23
25
|
// Configs
|
|
24
26
|
export declare const javascriptConfig: OxlintConfig;
|
package/index.mjs
CHANGED
|
@@ -11,6 +11,8 @@ export { playwrightRules } from './rules/playwright.mjs';
|
|
|
11
11
|
export { storybookRules } from './rules/storybook.mjs';
|
|
12
12
|
export { styledComponentsRules } from './rules/styled-components.mjs';
|
|
13
13
|
export { testingLibraryRules } from './rules/testing-library.mjs';
|
|
14
|
+
export { filenamesRules } from './rules/filenames.mjs';
|
|
15
|
+
export { barrelFilesRules } from './rules/barrel-files.mjs';
|
|
14
16
|
|
|
15
17
|
// Configs
|
|
16
18
|
export { default as javascriptConfig } from './configs/javascript.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistia/oxlint-config",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Wistia's Oxlint configurations",
|
|
5
5
|
"packageManager": "yarn@4.13.0",
|
|
6
6
|
"type": "module",
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@vitest/eslint-plugin": "^1.6.14",
|
|
41
|
+
"eslint-plugin-barrel-files": "^3.0.1",
|
|
42
|
+
"eslint-plugin-filenames": "^1.3.2",
|
|
41
43
|
"eslint-plugin-import-x": "^4.16.2",
|
|
42
44
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
43
45
|
"eslint-plugin-n": "^17.24.0",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// All barrel-files rules loaded via jsPlugins (no native oxlint support).
|
|
2
|
+
// see: https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/
|
|
3
|
+
export const barrelFilesRules = {
|
|
4
|
+
jsPlugins: ['eslint-plugin-barrel-files'],
|
|
5
|
+
rules: {
|
|
6
|
+
// Avoid barrel files
|
|
7
|
+
// https://github.com/thepassle/eslint-plugin-barrel-files/blob/main/docs/rules/avoid-barrel-files.md
|
|
8
|
+
'eslint-plugin-barrel-files/avoid-barrel-files': 'off',
|
|
9
|
+
|
|
10
|
+
// Avoid importing barrel files
|
|
11
|
+
// https://github.com/thepassle/eslint-plugin-barrel-files/blob/main/docs/rules/avoid-importing-barrel-files.md
|
|
12
|
+
'eslint-plugin-barrel-files/avoid-importing-barrel-files': 'off',
|
|
13
|
+
|
|
14
|
+
// Avoid namespace imports from barrel files
|
|
15
|
+
// https://github.com/thepassle/eslint-plugin-barrel-files/blob/main/docs/rules/avoid-namespace-import.md
|
|
16
|
+
'eslint-plugin-barrel-files/avoid-namespace-import': 'off',
|
|
17
|
+
|
|
18
|
+
// Avoid re-export all from barrel files
|
|
19
|
+
// https://github.com/thepassle/eslint-plugin-barrel-files/blob/main/docs/rules/avoid-re-export-all.md
|
|
20
|
+
'eslint-plugin-barrel-files/avoid-re-export-all': 'error',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// All filenames rules loaded via jsPlugins (no native oxlint support).
|
|
2
|
+
// see: https://github.com/selaux/eslint-plugin-filenames#rules
|
|
3
|
+
export const filenamesRules = {
|
|
4
|
+
jsPlugins: ['eslint-plugin-filenames'],
|
|
5
|
+
rules: {
|
|
6
|
+
// Match Exported Values
|
|
7
|
+
// https://github.com/selaux/eslint-plugin-filenames#matching-exported-values-match-exported
|
|
8
|
+
'eslint-plugin-filenames/match-exported': 'error',
|
|
9
|
+
|
|
10
|
+
// Consistent Filenames via regex
|
|
11
|
+
// https://github.com/selaux/eslint-plugin-filenames#consistent-filenames-via-regex-match-regex
|
|
12
|
+
'eslint-plugin-filenames/match-regex': 'off',
|
|
13
|
+
|
|
14
|
+
// Don't allow index files
|
|
15
|
+
// https://github.com/selaux/eslint-plugin-filenames#consistent-filenames-via-regex-match-regex
|
|
16
|
+
'eslint-plugin-filenames/no-index': 'off',
|
|
17
|
+
},
|
|
18
|
+
};
|