@aiou/eslint-config 3.1.2 → 3.2.0
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/dist/index.mjs +16 -3
- package/dts/configs/storybook.d.ts +2 -0
- package/dts/globs.d.ts +2 -0
- package/dts/typegen.d.ts +92 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -16,6 +16,7 @@ import pluginReact from '@eslint-react/eslint-plugin';
|
|
|
16
16
|
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
17
17
|
import pluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
18
18
|
import { configs } from 'eslint-plugin-regexp';
|
|
19
|
+
import storybookPlugin from 'eslint-plugin-storybook';
|
|
19
20
|
import pluginStylistic from '@stylistic/eslint-plugin';
|
|
20
21
|
import { createRequire } from 'node:module';
|
|
21
22
|
import pluginToml from 'eslint-plugin-toml';
|
|
@@ -158,7 +159,8 @@ const imports = () => {
|
|
|
158
159
|
// ignore require third packages in .eslintrc.* e.g. eslint-define-config
|
|
159
160
|
`**/.eslintrc.${GLOB_SCRIPT_EXT}`,
|
|
160
161
|
`**/**/eslint.config.${GLOB_SCRIPT_EXT}`,
|
|
161
|
-
"**/{vite,esbuild,rollup,webpack,rspack}.ts"
|
|
162
|
+
"**/{vite,esbuild,rollup,webpack,rspack}.ts",
|
|
163
|
+
"**/vitest.setup.*"
|
|
162
164
|
],
|
|
163
165
|
rules: {
|
|
164
166
|
"import/no-extraneous-dependencies": "off"
|
|
@@ -975,6 +977,13 @@ const regexp = () => {
|
|
|
975
977
|
return config;
|
|
976
978
|
};
|
|
977
979
|
|
|
980
|
+
const storybook = () => {
|
|
981
|
+
const config = [
|
|
982
|
+
...storybookPlugin.configs["flat/recommended"]
|
|
983
|
+
];
|
|
984
|
+
return config;
|
|
985
|
+
};
|
|
986
|
+
|
|
978
987
|
const stylistic = () => {
|
|
979
988
|
const config = pluginStylistic.configs.customize({
|
|
980
989
|
indent: 2,
|
|
@@ -1283,6 +1292,8 @@ const unicorn = () => {
|
|
|
1283
1292
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1284
1293
|
"unicorn/prefer-type-error": "error",
|
|
1285
1294
|
"unicorn/throw-new-error": "error",
|
|
1295
|
+
"unicorn/prevent-abbreviations": "off",
|
|
1296
|
+
"unicorn/no-null": "off",
|
|
1286
1297
|
"unicorn/filename-case": ["error", {
|
|
1287
1298
|
case: "kebabCase",
|
|
1288
1299
|
ignore: [/^[A-Z]+\.md$/, /^[A-Z]+\.yml$/, /^\.?[A-Z]/, /^Dockerfile$/]
|
|
@@ -1337,14 +1348,16 @@ const presetDefault = [
|
|
|
1337
1348
|
...react(),
|
|
1338
1349
|
...stylistic(),
|
|
1339
1350
|
...presetLangsExtensions,
|
|
1340
|
-
...progress()
|
|
1351
|
+
...progress(),
|
|
1352
|
+
...storybook()
|
|
1341
1353
|
];
|
|
1342
1354
|
const all = [
|
|
1343
1355
|
...presetDefault,
|
|
1344
1356
|
...tailwindcss(),
|
|
1345
1357
|
...next(),
|
|
1346
1358
|
...ssrReact(),
|
|
1347
|
-
...regexp()
|
|
1359
|
+
...regexp(),
|
|
1360
|
+
...storybook()
|
|
1348
1361
|
];
|
|
1349
1362
|
const aiou = ({ ssr = true, regexp: regexp$1 = true, tailwindcss: enableTailwindcss = true } = {}, ...userConfigs) => {
|
|
1350
1363
|
const configs = [...presetDefault];
|
package/dts/globs.d.ts
CHANGED
|
@@ -17,3 +17,5 @@ export declare const GLOB_MARKDOWN = "**/*.md";
|
|
|
17
17
|
export declare const GLOB_VUE = "**/*.vue";
|
|
18
18
|
export declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
19
19
|
export declare const GLOB_WORKFLOW_YAML = "**/.github/**/*.y?(a)ml";
|
|
20
|
+
export declare const GLOB_STORYBOOK_STORIES = "**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)";
|
|
21
|
+
export declare const GLOB_STORYBOOK_MAIN = ".storybook/main.@(js|cjs|mjs|ts)";
|
package/dts/typegen.d.ts
CHANGED
|
@@ -5700,6 +5700,86 @@ export interface Rules {
|
|
|
5700
5700
|
* @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/use-ignore-case.html
|
|
5701
5701
|
*/
|
|
5702
5702
|
'regexp/use-ignore-case'?: Linter.RuleEntry<[]>;
|
|
5703
|
+
/**
|
|
5704
|
+
* Interactions should be awaited
|
|
5705
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/await-interactions.md
|
|
5706
|
+
*/
|
|
5707
|
+
'storybook/await-interactions'?: Linter.RuleEntry<[]>;
|
|
5708
|
+
/**
|
|
5709
|
+
* Pass a context when invoking play function of another story
|
|
5710
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/context-in-play-function.md
|
|
5711
|
+
*/
|
|
5712
|
+
'storybook/context-in-play-function'?: Linter.RuleEntry<[]>;
|
|
5713
|
+
/**
|
|
5714
|
+
* The component property should be set
|
|
5715
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/csf-component.md
|
|
5716
|
+
*/
|
|
5717
|
+
'storybook/csf-component'?: Linter.RuleEntry<[]>;
|
|
5718
|
+
/**
|
|
5719
|
+
* Story files should have a default export
|
|
5720
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/default-exports.md
|
|
5721
|
+
*/
|
|
5722
|
+
'storybook/default-exports'?: Linter.RuleEntry<[]>;
|
|
5723
|
+
/**
|
|
5724
|
+
* Deprecated hierarchy separator in title property
|
|
5725
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/hierarchy-separator.md
|
|
5726
|
+
*/
|
|
5727
|
+
'storybook/hierarchy-separator'?: Linter.RuleEntry<[]>;
|
|
5728
|
+
/**
|
|
5729
|
+
* Meta should only have inline properties
|
|
5730
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/meta-inline-properties.md
|
|
5731
|
+
*/
|
|
5732
|
+
'storybook/meta-inline-properties'?: Linter.RuleEntry<StorybookMetaInlineProperties>;
|
|
5733
|
+
/**
|
|
5734
|
+
* Meta should use `satisfies Meta`
|
|
5735
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/meta-satisfies-type.md
|
|
5736
|
+
*/
|
|
5737
|
+
'storybook/meta-satisfies-type'?: Linter.RuleEntry<[]>;
|
|
5738
|
+
/**
|
|
5739
|
+
* A story should not have a redundant name property
|
|
5740
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/no-redundant-story-name.md
|
|
5741
|
+
*/
|
|
5742
|
+
'storybook/no-redundant-story-name'?: Linter.RuleEntry<[]>;
|
|
5743
|
+
/**
|
|
5744
|
+
* Do not import renderer packages directly in stories
|
|
5745
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/no-renderer-packages.md
|
|
5746
|
+
*/
|
|
5747
|
+
'storybook/no-renderer-packages'?: Linter.RuleEntry<[]>;
|
|
5748
|
+
/**
|
|
5749
|
+
* storiesOf is deprecated and should not be used
|
|
5750
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/no-stories-of.md
|
|
5751
|
+
*/
|
|
5752
|
+
'storybook/no-stories-of'?: Linter.RuleEntry<[]>;
|
|
5753
|
+
/**
|
|
5754
|
+
* Do not define a title in meta
|
|
5755
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/no-title-property-in-meta.md
|
|
5756
|
+
*/
|
|
5757
|
+
'storybook/no-title-property-in-meta'?: Linter.RuleEntry<[]>;
|
|
5758
|
+
/**
|
|
5759
|
+
* This rule identifies storybook addons that are invalid because they are either not installed or contain a typo in their name.
|
|
5760
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/no-uninstalled-addons.md
|
|
5761
|
+
*/
|
|
5762
|
+
'storybook/no-uninstalled-addons'?: Linter.RuleEntry<StorybookNoUninstalledAddons>;
|
|
5763
|
+
/**
|
|
5764
|
+
* Stories should use PascalCase
|
|
5765
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/prefer-pascal-case.md
|
|
5766
|
+
*/
|
|
5767
|
+
'storybook/prefer-pascal-case'?: Linter.RuleEntry<[]>;
|
|
5768
|
+
/**
|
|
5769
|
+
* A story file must contain at least one story export
|
|
5770
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/story-exports.md
|
|
5771
|
+
*/
|
|
5772
|
+
'storybook/story-exports'?: Linter.RuleEntry<[]>;
|
|
5773
|
+
/**
|
|
5774
|
+
* Use expect from `@storybook/test`, `storybook/test` or `@storybook/jest`
|
|
5775
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/use-storybook-expect.md
|
|
5776
|
+
*/
|
|
5777
|
+
'storybook/use-storybook-expect'?: Linter.RuleEntry<[]>;
|
|
5778
|
+
/**
|
|
5779
|
+
* Do not use testing-library directly on stories
|
|
5780
|
+
* @see https://github.com/storybookjs/storybook/blob/next/code/lib/eslint-plugin/docs/rules/use-storybook-testing-library.md
|
|
5781
|
+
*/
|
|
5782
|
+
'storybook/use-storybook-testing-library'?: Linter.RuleEntry<[]>;
|
|
5703
5783
|
/**
|
|
5704
5784
|
* Enforce a consistent and logical order of the Tailwind CSS classnames
|
|
5705
5785
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/classnames-order.md
|
|
@@ -13439,6 +13519,17 @@ type RegexpUnicodeProperty = [] | [
|
|
|
13439
13519
|
});
|
|
13440
13520
|
}
|
|
13441
13521
|
];
|
|
13522
|
+
type StorybookMetaInlineProperties = [] | [
|
|
13523
|
+
{
|
|
13524
|
+
csfVersion?: number;
|
|
13525
|
+
}
|
|
13526
|
+
];
|
|
13527
|
+
type StorybookNoUninstalledAddons = [] | [
|
|
13528
|
+
{
|
|
13529
|
+
packageJsonLocation?: string;
|
|
13530
|
+
ignore?: string[];
|
|
13531
|
+
}
|
|
13532
|
+
];
|
|
13442
13533
|
type TailwindcssClassnamesOrder = [] | [
|
|
13443
13534
|
{
|
|
13444
13535
|
callees?: string[];
|
|
@@ -14218,5 +14309,5 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
14218
14309
|
markers?: string[];
|
|
14219
14310
|
}
|
|
14220
14311
|
];
|
|
14221
|
-
export type ConfigNames = 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'tailwindcss:base' | 'tailwindcss:rules';
|
|
14312
|
+
export type ConfigNames = 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'storybook:recommended:setup' | 'storybook:recommended:stories-rules' | 'storybook:recommended:main-rules' | 'tailwindcss:base' | 'tailwindcss:rules' | 'storybook:recommended:setup' | 'storybook:recommended:stories-rules' | 'storybook:recommended:main-rules';
|
|
14222
14313
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiou/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "eslint config for JW",
|
|
6
6
|
"keywords": [],
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
56
56
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
57
57
|
"eslint-plugin-regexp": "^3.1.0",
|
|
58
|
-
"eslint-plugin-
|
|
58
|
+
"eslint-plugin-storybook": "^10.4.0",
|
|
59
|
+
"eslint-plugin-tailwindcss": "^4.0.0-alpha.5",
|
|
59
60
|
"eslint-plugin-toml": "^1.3.1",
|
|
60
61
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
61
62
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"jsonc-eslint-parser": "^3.1.0",
|
|
65
66
|
"local-pkg": "^1.1.2",
|
|
66
67
|
"yaml-eslint-parser": "^2.0.0",
|
|
67
|
-
"@aiou/eslint-ignore": "0.6.
|
|
68
|
+
"@aiou/eslint-ignore": "0.6.2",
|
|
68
69
|
"@aiou/eslint-plugin-progress": "0.4.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|