@dvukovic/style-guide 0.3.121 → 0.4.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/.packagerc.d.ts +3 -0
- package/dist/.release-it.d.ts +39 -0
- package/dist/cspell.config.d.ts +3 -0
- package/dist/eslint.config.d.ts +2 -0
- package/dist/prettier.config.d.ts +3 -0
- package/dist/src/eslint/configs/core.d.ts +8 -0
- package/dist/src/eslint/configs/core.test.d.ts +1 -0
- package/dist/src/eslint/configs/jest.d.ts +7 -0
- package/dist/src/eslint/configs/jest.test.d.ts +1 -0
- package/dist/src/eslint/configs/mobx.d.ts +8 -0
- package/dist/src/eslint/configs/mobx.test.d.ts +1 -0
- package/dist/src/eslint/configs/next.d.ts +8 -0
- package/dist/src/eslint/configs/next.test.d.ts +1 -0
- package/dist/src/eslint/configs/node.d.ts +8 -0
- package/dist/src/eslint/configs/node.test.d.ts +1 -0
- package/dist/src/eslint/configs/package-json.d.ts +22 -0
- package/dist/src/eslint/configs/package-json.test.d.ts +1 -0
- package/dist/src/eslint/configs/playwright.d.ts +8 -0
- package/dist/src/eslint/configs/playwright.test.d.ts +1 -0
- package/dist/src/eslint/configs/react.d.ts +8 -0
- package/dist/src/eslint/configs/react.test.d.ts +1 -0
- package/dist/src/eslint/configs/storybook.d.ts +7 -0
- package/dist/src/eslint/configs/storybook.test.d.ts +1 -0
- package/dist/src/eslint/configs/typescript-strict.d.ts +9 -0
- package/dist/src/eslint/configs/typescript-strict.test.d.ts +1 -0
- package/dist/src/eslint/configs/typescript.d.ts +20 -0
- package/dist/src/eslint/configs/typescript.test.d.ts +1 -0
- package/dist/src/eslint/configs/vitest.d.ts +8 -0
- package/dist/src/eslint/configs/vitest.test.d.ts +1 -0
- package/dist/src/eslint/index.d.ts +20 -0
- package/dist/src/eslint/plugins/baseline.d.ts +2 -0
- package/dist/src/eslint/plugins/dvukovic.d.ts +2 -0
- package/dist/src/eslint/plugins/eslint-comments.d.ts +2 -0
- package/dist/src/eslint/plugins/eslint.d.ts +2 -0
- package/dist/src/eslint/plugins/eslint.test.d.ts +1 -0
- package/dist/src/eslint/plugins/import-x.d.ts +2 -0
- package/dist/src/eslint/plugins/jest.d.ts +2 -0
- package/dist/src/eslint/plugins/mobx.d.ts +2 -0
- package/dist/src/eslint/plugins/n.d.ts +2 -0
- package/dist/src/eslint/plugins/next.d.ts +2 -0
- package/dist/src/eslint/plugins/package-json.d.ts +2 -0
- package/dist/src/eslint/plugins/playwright.d.ts +2 -0
- package/dist/src/eslint/plugins/promise.d.ts +2 -0
- package/dist/src/eslint/plugins/react-hooks.d.ts +2 -0
- package/dist/src/eslint/plugins/react.d.ts +2 -0
- package/dist/src/eslint/plugins/rimac.d.ts +2 -0
- package/dist/src/eslint/plugins/security-node.d.ts +2 -0
- package/dist/src/eslint/plugins/simple-import-sort.d.ts +2 -0
- package/dist/src/eslint/plugins/sonarjs.d.ts +2 -0
- package/dist/src/eslint/plugins/sort-destructure-keys.d.ts +2 -0
- package/dist/src/eslint/plugins/sort-keys-fix.d.ts +2 -0
- package/dist/src/eslint/plugins/storybook.d.ts +2 -0
- package/dist/src/eslint/plugins/stylistic.d.ts +2 -0
- package/dist/src/eslint/plugins/typescript-eslint.d.ts +2 -0
- package/dist/src/eslint/plugins/typescript-sort-keys.d.ts +2 -0
- package/dist/src/eslint/plugins/unicorn.d.ts +2 -0
- package/dist/src/eslint/plugins/unused-imports.d.ts +2 -0
- package/dist/src/eslint/plugins/vitest.d.ts +2 -0
- package/dist/src/eslint/rules/no-commented-out-code/no-commented-out-code.d.ts +15 -0
- package/dist/src/eslint/rules/no-commented-out-code/no-commented-out-code.test.d.ts +1 -0
- package/dist/src/eslint/rules/no-commented-out-code/no-commented-out-code.utils.d.ts +10 -0
- package/dist/src/eslint/rules/no-restricted-dependencies/no-restricted-dependencies.d.ts +48 -0
- package/dist/src/eslint/rules/no-restricted-dependencies/no-restricted-dependencies.test.d.ts +1 -0
- package/dist/src/eslint/rules/no-t/no-t.d.ts +25 -0
- package/dist/src/eslint/rules/no-t/no-t.test.d.ts +1 -0
- package/dist/src/eslint/rules/require-properties/require-properties.d.ts +33 -0
- package/dist/src/eslint/rules/require-properties/require-properties.test.d.ts +1 -0
- package/dist/src/eslint/rules/valid-engines-node/valid-engines-node.d.ts +27 -0
- package/dist/src/eslint/rules/valid-engines-node/valid-engines-node.test.d.ts +1 -0
- package/dist/src/prettier/configs/core.d.ts +3 -0
- package/dist/src/prettier/configs/core.test.d.ts +1 -0
- package/dist/src/prettier/plugins/embed.d.ts +3 -0
- package/dist/src/prettier/plugins/prettier.d.ts +3 -0
- package/dist/src/prettier/plugins/sql.d.ts +3 -0
- package/dist/src/stylelint/configs/core.d.ts +3 -0
- package/dist/src/stylelint/configs/core.test.d.ts +1 -0
- package/dist/src/stylelint/plugins/no-unused-selectors.d.ts +3 -0
- package/dist/src/stylelint/plugins/order.d.ts +3 -0
- package/dist/src/stylelint/plugins/stylelint.d.ts +3 -0
- package/dist/stylelint.config.d.ts +3 -0
- package/dist/vitest.config.d.ts +2 -0
- package/package.json +18 -10
- package/src/eslint/configs/core.js +13 -3
- package/src/eslint/configs/jest.js +6 -4
- package/src/eslint/configs/mobx.js +5 -3
- package/src/eslint/configs/next.js +5 -3
- package/src/eslint/configs/node.js +13 -3
- package/src/eslint/configs/package-json.js +13 -6
- package/src/eslint/configs/playwright.js +5 -2
- package/src/eslint/configs/react.js +5 -3
- package/src/eslint/configs/storybook.js +23 -16
- package/src/eslint/configs/typescript-strict.js +6 -3
- package/src/eslint/configs/typescript.js +13 -3
- package/src/eslint/configs/vitest.js +5 -2
- package/src/eslint/index.js +1 -0
- package/src/eslint/plugins/jest.js +22 -3
- package/src/eslint/plugins/react-hooks.js +4 -5
- package/src/eslint/plugins/storybook.js +22 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
namespace git {
|
|
3
|
+
let commitMessage: string;
|
|
4
|
+
let requireBranch: string;
|
|
5
|
+
let requireCleanWorkingDir: boolean;
|
|
6
|
+
let tagName: string;
|
|
7
|
+
}
|
|
8
|
+
namespace github {
|
|
9
|
+
let release: boolean;
|
|
10
|
+
let releaseName: string;
|
|
11
|
+
}
|
|
12
|
+
namespace npm {
|
|
13
|
+
let publish: boolean;
|
|
14
|
+
let skipChecks: boolean;
|
|
15
|
+
}
|
|
16
|
+
let plugins: {
|
|
17
|
+
"@release-it/conventional-changelog": {
|
|
18
|
+
header: string;
|
|
19
|
+
infile: string;
|
|
20
|
+
preset: {
|
|
21
|
+
name: string;
|
|
22
|
+
types: ({
|
|
23
|
+
section: string;
|
|
24
|
+
type: string;
|
|
25
|
+
hidden?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
hidden: boolean;
|
|
28
|
+
section: string;
|
|
29
|
+
type: string;
|
|
30
|
+
})[];
|
|
31
|
+
};
|
|
32
|
+
whatBump: (commits: any) => {
|
|
33
|
+
level: number;
|
|
34
|
+
reason: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core ESLint configuration with essential rules and plugins
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function core(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const coreConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jest testing framework configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function jest(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MobX state management configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function mobx(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const mobxConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js framework configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function next(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const nextConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js ESLint configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function node(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const nodeConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package.json ESLint configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config]
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends}
|
|
6
|
+
*/
|
|
7
|
+
export function packageJson(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
/**
|
|
9
|
+
* Package.json ESLint configuration for monorepos
|
|
10
|
+
*
|
|
11
|
+
* Returns two configs:
|
|
12
|
+
*
|
|
13
|
+
* - Root package.json: all rules including volta.node requirement
|
|
14
|
+
* - Nested packages: same rules but no volta.node requirement
|
|
15
|
+
*
|
|
16
|
+
* @param {{ workspacePatterns?: string[] } & import("@eslint/config-helpers").ConfigWithExtends} [config]
|
|
17
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends[]}
|
|
18
|
+
*/
|
|
19
|
+
export function packageJsonWorkspace(config?: {
|
|
20
|
+
workspacePatterns?: string[];
|
|
21
|
+
} & import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends[];
|
|
22
|
+
export const packageJsonConfigs: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playwright testing configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function playwright(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const playwrightConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React framework configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function react(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const reactConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storybook ESLint configuration with relaxed rules for story files
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function storybook(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strict TypeScript ESLint configuration with additional safety rules
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function typescriptStrict(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
/** @type {import("@eslint/config-helpers").Config[]} */
|
|
9
|
+
export const typescriptStrictConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript ESLint configuration with parser setup and rules
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function typescript(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const typescriptConfig: {
|
|
9
|
+
name?: string;
|
|
10
|
+
basePath?: string;
|
|
11
|
+
files: (string | string[])[];
|
|
12
|
+
ignores?: string[];
|
|
13
|
+
language?: string;
|
|
14
|
+
languageOptions?: import("@eslint/core").LanguageOptions;
|
|
15
|
+
linterOptions?: import("@eslint/core").LinterOptionsConfig;
|
|
16
|
+
processor?: string | import("@eslint/core").Processor;
|
|
17
|
+
plugins?: Record<string, import("@eslint/core").Plugin>;
|
|
18
|
+
rules?: Partial<import("@eslint/core").RulesConfig> | undefined;
|
|
19
|
+
settings?: Record<string, unknown>;
|
|
20
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest testing framework configuration
|
|
3
|
+
*
|
|
4
|
+
* @param {import("@eslint/config-helpers").ConfigWithExtends} [config] - Additional config
|
|
5
|
+
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
6
|
+
*/
|
|
7
|
+
export function vitest(config?: import("@eslint/config-helpers").ConfigWithExtends): import("@eslint/config-helpers").ConfigWithExtends;
|
|
8
|
+
export const vitestConfig: import("@eslint/config-helpers").Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom wrapper for ESLint defineConfig with simplified API
|
|
3
|
+
*
|
|
4
|
+
* @param {string[]} ignores - Paths to ignore
|
|
5
|
+
* @param {Array} configs - Array of ESLint config objects
|
|
6
|
+
* @returns {Array} ESLint configuration
|
|
7
|
+
*/
|
|
8
|
+
export function customDefineConfig(ignores: string[], configs?: any[]): any[];
|
|
9
|
+
export * from "./configs/core.js";
|
|
10
|
+
export * from "./configs/jest.js";
|
|
11
|
+
export * from "./configs/mobx.js";
|
|
12
|
+
export * from "./configs/next.js";
|
|
13
|
+
export * from "./configs/node.js";
|
|
14
|
+
export * from "./configs/package-json.js";
|
|
15
|
+
export * from "./configs/playwright.js";
|
|
16
|
+
export * from "./configs/react.js";
|
|
17
|
+
export * from "./configs/storybook.js";
|
|
18
|
+
export * from "./configs/typescript.js";
|
|
19
|
+
export * from "./configs/typescript-strict.js";
|
|
20
|
+
export * from "./configs/vitest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export namespace noCommentedOutCode {
|
|
2
|
+
function create(context: any): {
|
|
3
|
+
Program(): void;
|
|
4
|
+
};
|
|
5
|
+
namespace meta {
|
|
6
|
+
namespace docs {
|
|
7
|
+
let description: string;
|
|
8
|
+
}
|
|
9
|
+
namespace messages {
|
|
10
|
+
let forbidden: string;
|
|
11
|
+
}
|
|
12
|
+
let schema: never[];
|
|
13
|
+
let type: string;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function isExpressionOrIdentifierOrLiteral(node: any): any;
|
|
2
|
+
export function hasEmptyBody(program: any): boolean;
|
|
3
|
+
export function hasExpressionBody(program: any): any;
|
|
4
|
+
export function hasLabeledStatementBody(program: any): boolean;
|
|
5
|
+
export function isRegionComment(content: any): boolean;
|
|
6
|
+
export function toBlocks(comments: any): {
|
|
7
|
+
content: any;
|
|
8
|
+
loc: any;
|
|
9
|
+
}[];
|
|
10
|
+
export function wrapContent(content: any, node: any): string | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export namespace noRestrictedDependencies {
|
|
2
|
+
function create(context: any): {
|
|
3
|
+
JSONProperty(node: any): void;
|
|
4
|
+
};
|
|
5
|
+
namespace meta {
|
|
6
|
+
namespace docs {
|
|
7
|
+
let description: string;
|
|
8
|
+
}
|
|
9
|
+
namespace messages {
|
|
10
|
+
let restricted: string;
|
|
11
|
+
}
|
|
12
|
+
let schema: {
|
|
13
|
+
additionalProperties: boolean;
|
|
14
|
+
properties: {
|
|
15
|
+
dependencies: {
|
|
16
|
+
description: string;
|
|
17
|
+
items: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
devDependencies: {
|
|
23
|
+
description: string;
|
|
24
|
+
items: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
optionalDependencies: {
|
|
30
|
+
description: string;
|
|
31
|
+
items: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
peerDependencies: {
|
|
37
|
+
description: string;
|
|
38
|
+
items: {
|
|
39
|
+
type: string;
|
|
40
|
+
};
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type: string;
|
|
45
|
+
}[];
|
|
46
|
+
let type: string;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export namespace noT {
|
|
2
|
+
function create(context: any): {
|
|
3
|
+
"TSTypeParameter > Identifier[name=/^.$/]"(node: any): void;
|
|
4
|
+
"TSTypeParameter > Identifier[name=/^.{2,}$/]"(node: any): void;
|
|
5
|
+
};
|
|
6
|
+
namespace meta {
|
|
7
|
+
namespace docs {
|
|
8
|
+
let description: string;
|
|
9
|
+
}
|
|
10
|
+
namespace messages {
|
|
11
|
+
let forbidden: string;
|
|
12
|
+
let prefix: string;
|
|
13
|
+
}
|
|
14
|
+
let schema: {
|
|
15
|
+
additionalProperties: boolean;
|
|
16
|
+
properties: {
|
|
17
|
+
prefix: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
type: string;
|
|
22
|
+
}[];
|
|
23
|
+
let type: string;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export namespace requireProperties {
|
|
2
|
+
function create(context: any): {
|
|
3
|
+
JSONExpressionStatement?: undefined;
|
|
4
|
+
JSONProperty?: undefined;
|
|
5
|
+
"Program:exit"?: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
JSONExpressionStatement(node: any): void;
|
|
8
|
+
JSONProperty(node: any): void;
|
|
9
|
+
"Program:exit"(): void;
|
|
10
|
+
};
|
|
11
|
+
namespace meta {
|
|
12
|
+
namespace docs {
|
|
13
|
+
let description: string;
|
|
14
|
+
}
|
|
15
|
+
namespace messages {
|
|
16
|
+
let missingProperty: string;
|
|
17
|
+
}
|
|
18
|
+
let schema: {
|
|
19
|
+
additionalProperties: boolean;
|
|
20
|
+
properties: {
|
|
21
|
+
properties: {
|
|
22
|
+
description: string;
|
|
23
|
+
items: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type: string;
|
|
30
|
+
}[];
|
|
31
|
+
let type: string;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export namespace validEnginesNode {
|
|
2
|
+
function create(context: any): {
|
|
3
|
+
JSONProperty(node: any): void;
|
|
4
|
+
};
|
|
5
|
+
namespace meta {
|
|
6
|
+
namespace docs {
|
|
7
|
+
let description: string;
|
|
8
|
+
}
|
|
9
|
+
namespace messages {
|
|
10
|
+
let invalidVersion: string;
|
|
11
|
+
}
|
|
12
|
+
let schema: {
|
|
13
|
+
additionalProperties: boolean;
|
|
14
|
+
properties: {
|
|
15
|
+
versions: {
|
|
16
|
+
description: string;
|
|
17
|
+
items: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type: string;
|
|
24
|
+
}[];
|
|
25
|
+
let type: string;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvukovic/style-guide",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "My own style guide",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,14 +11,26 @@
|
|
|
11
11
|
"name": "Domagoj Vukovic"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./src/cspell/dictionary.txt": "./src/cspell/dictionary.txt",
|
|
16
|
+
"./src/eslint/index.js": {
|
|
17
|
+
"types": "./dist/src/eslint/index.d.ts",
|
|
18
|
+
"default": "./src/eslint/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./src/package-json/index.js": "./src/package-json/index.js",
|
|
21
|
+
"./src/prettier/index.js": "./src/prettier/index.js",
|
|
22
|
+
"./src/stylelint/index.js": "./src/stylelint/index.js"
|
|
23
|
+
},
|
|
14
24
|
"files": [
|
|
15
|
-
"
|
|
25
|
+
"dist",
|
|
16
26
|
"src/cspell",
|
|
27
|
+
"src/eslint",
|
|
28
|
+
"src/package-json",
|
|
17
29
|
"src/prettier",
|
|
18
|
-
"src/stylelint"
|
|
19
|
-
"src/package-json"
|
|
30
|
+
"src/stylelint"
|
|
20
31
|
],
|
|
21
32
|
"scripts": {
|
|
33
|
+
"build": "tsc",
|
|
22
34
|
"lint": "yarn lint:eslint && yarn lint:prettier && yarn lint:stylelint && yarn lint:cspell",
|
|
23
35
|
"lint:cspell": "cspell --no-progress --no-summary --unique '**'",
|
|
24
36
|
"lint:eslint": "eslint . --cache --concurrency=auto",
|
|
@@ -31,6 +43,7 @@
|
|
|
31
43
|
"dependencies": {
|
|
32
44
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
33
45
|
"@eslint/compat": "2.0.0",
|
|
46
|
+
"@eslint/config-helpers": "0.4.2",
|
|
34
47
|
"@next/eslint-plugin-next": "16.1.0",
|
|
35
48
|
"@prettier/plugin-xml": "3.4.2",
|
|
36
49
|
"@rimac-technology/eslint-plugin": "1.5.0",
|
|
@@ -71,18 +84,13 @@
|
|
|
71
84
|
"typescript-eslint": "8.50.0"
|
|
72
85
|
},
|
|
73
86
|
"devDependencies": {
|
|
74
|
-
"@
|
|
87
|
+
"@release-it/conventional-changelog": "10.0.4",
|
|
75
88
|
"@types/eslint": "9.6.1",
|
|
76
|
-
"@types/jest": "30.0.0",
|
|
77
89
|
"@types/node": "24.10.4",
|
|
78
|
-
"@types/react": "19.2.7",
|
|
79
90
|
"cspell": "9.4.0",
|
|
80
91
|
"eslint": "9.39.2",
|
|
81
|
-
"jest": "30.2.0",
|
|
82
92
|
"prettier": "3.7.4",
|
|
83
|
-
"react": "19.2.3",
|
|
84
93
|
"release-it": "19.1.0",
|
|
85
|
-
"storybook": "10.1.10",
|
|
86
94
|
"stylelint": "16.26.1",
|
|
87
95
|
"typescript": "5.9.3",
|
|
88
96
|
"vitest": "4.0.16"
|
|
@@ -37,9 +37,19 @@ export const coreConfig = [
|
|
|
37
37
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
38
38
|
*/
|
|
39
39
|
export function core(config) {
|
|
40
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
41
|
+
|
|
40
42
|
return {
|
|
41
|
-
extends: [...coreConfig, ...(
|
|
42
|
-
files: [
|
|
43
|
-
|
|
43
|
+
extends: [...coreConfig, ...(extendsConfig ?? [])],
|
|
44
|
+
files: [
|
|
45
|
+
"**/*.js",
|
|
46
|
+
".*.js",
|
|
47
|
+
"**/*.cjs",
|
|
48
|
+
"**/*.mjs",
|
|
49
|
+
"**/*.ts",
|
|
50
|
+
"**/*.tsx",
|
|
51
|
+
...(files ?? []),
|
|
52
|
+
],
|
|
53
|
+
...rest,
|
|
44
54
|
}
|
|
45
55
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jest as jestPlugin } from "../plugins/jest.js"
|
|
2
2
|
|
|
3
|
-
export const jestConfig = [jestPlugin]
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Jest testing framework configuration
|
|
7
5
|
*
|
|
@@ -9,8 +7,11 @@ export const jestConfig = [jestPlugin]
|
|
|
9
7
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
10
8
|
*/
|
|
11
9
|
export function jest(config) {
|
|
10
|
+
const jestConfig = [jestPlugin]
|
|
11
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
12
|
+
|
|
12
13
|
return {
|
|
13
|
-
extends: [...jestConfig, ...(
|
|
14
|
+
extends: [...jestConfig, ...(extendsConfig ?? [])],
|
|
14
15
|
files: [
|
|
15
16
|
"**/*.test.js",
|
|
16
17
|
"**/*.test.ts",
|
|
@@ -22,7 +23,8 @@ export function jest(config) {
|
|
|
22
23
|
"**/*.int.test.ts",
|
|
23
24
|
"**/*.integration.test.js",
|
|
24
25
|
"**/*.integration.test.ts",
|
|
26
|
+
...(files ?? []),
|
|
25
27
|
],
|
|
26
|
-
...
|
|
28
|
+
...rest,
|
|
27
29
|
}
|
|
28
30
|
}
|
|
@@ -9,9 +9,11 @@ export const mobxConfig = [mobxPlugin]
|
|
|
9
9
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
10
10
|
*/
|
|
11
11
|
export function mobx(config) {
|
|
12
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
13
|
+
|
|
12
14
|
return {
|
|
13
|
-
extends: [...mobxConfig, ...(
|
|
14
|
-
files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
|
|
15
|
-
...
|
|
15
|
+
extends: [...mobxConfig, ...(extendsConfig ?? [])],
|
|
16
|
+
files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx", ...(files ?? [])],
|
|
17
|
+
...rest,
|
|
16
18
|
}
|
|
17
19
|
}
|
|
@@ -9,9 +9,11 @@ export const nextConfig = [nextPlugin]
|
|
|
9
9
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
10
10
|
*/
|
|
11
11
|
export function next(config) {
|
|
12
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
13
|
+
|
|
12
14
|
return {
|
|
13
|
-
extends: [...nextConfig, ...(
|
|
14
|
-
files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
|
|
15
|
-
...
|
|
15
|
+
extends: [...nextConfig, ...(extendsConfig ?? [])],
|
|
16
|
+
files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx", ...(files ?? [])],
|
|
17
|
+
...rest,
|
|
16
18
|
}
|
|
17
19
|
}
|
|
@@ -10,9 +10,19 @@ export const nodeConfig = [nodeN, securityNode]
|
|
|
10
10
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
11
11
|
*/
|
|
12
12
|
export function node(config) {
|
|
13
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
14
|
+
|
|
13
15
|
return {
|
|
14
|
-
extends: [...nodeConfig, ...(
|
|
15
|
-
files: [
|
|
16
|
-
|
|
16
|
+
extends: [...nodeConfig, ...(extendsConfig ?? [])],
|
|
17
|
+
files: [
|
|
18
|
+
"**/*.js",
|
|
19
|
+
"**/*.cjs",
|
|
20
|
+
"**/*.mjs",
|
|
21
|
+
"**/*.ts",
|
|
22
|
+
"**/*.cts",
|
|
23
|
+
"**/*.mts",
|
|
24
|
+
...(files ?? []),
|
|
25
|
+
],
|
|
26
|
+
...rest,
|
|
17
27
|
}
|
|
18
28
|
}
|
|
@@ -11,10 +11,12 @@ export const packageJsonConfigs = [packageJsonRules]
|
|
|
11
11
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends}
|
|
12
12
|
*/
|
|
13
13
|
export function packageJson(config) {
|
|
14
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
15
|
+
|
|
14
16
|
return {
|
|
15
|
-
extends: [...packageJsonConfigs, ...(
|
|
16
|
-
files: ["**/package.json"],
|
|
17
|
-
...
|
|
17
|
+
extends: [...packageJsonConfigs, ...(extendsConfig ?? [])],
|
|
18
|
+
files: ["**/package.json", ...(files ?? [])],
|
|
19
|
+
...rest,
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -30,12 +32,17 @@ export function packageJson(config) {
|
|
|
30
32
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends[]}
|
|
31
33
|
*/
|
|
32
34
|
export function packageJsonWorkspace(config) {
|
|
33
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
extends: extendsConfig,
|
|
37
|
+
files,
|
|
38
|
+
workspacePatterns = DEFAULT_WORKSPACE_PATTERNS,
|
|
39
|
+
...rest
|
|
40
|
+
} = config ?? {}
|
|
34
41
|
|
|
35
42
|
return [
|
|
36
43
|
{
|
|
37
|
-
extends: [...packageJsonConfigs, ...(
|
|
38
|
-
files: ["package.json"],
|
|
44
|
+
extends: [...packageJsonConfigs, ...(extendsConfig ?? [])],
|
|
45
|
+
files: ["package.json", ...(files ?? [])],
|
|
39
46
|
...rest,
|
|
40
47
|
},
|
|
41
48
|
{
|
|
@@ -9,8 +9,10 @@ export const playwrightConfig = [playwrightPlugin]
|
|
|
9
9
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
10
10
|
*/
|
|
11
11
|
export function playwright(config) {
|
|
12
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
13
|
+
|
|
12
14
|
return {
|
|
13
|
-
extends: [...playwrightConfig, ...(
|
|
15
|
+
extends: [...playwrightConfig, ...(extendsConfig ?? [])],
|
|
14
16
|
files: [
|
|
15
17
|
"**/*.test.js",
|
|
16
18
|
"**/*.test.ts",
|
|
@@ -22,7 +24,8 @@ export function playwright(config) {
|
|
|
22
24
|
"**/*.int.test.ts",
|
|
23
25
|
"**/*.integration.test.js",
|
|
24
26
|
"**/*.integration.test.ts",
|
|
27
|
+
...(files ?? []),
|
|
25
28
|
],
|
|
26
|
-
...
|
|
29
|
+
...rest,
|
|
27
30
|
}
|
|
28
31
|
}
|
|
@@ -10,9 +10,11 @@ export const reactConfig = [reactPlugin, reactHooksPlugin]
|
|
|
10
10
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
11
11
|
*/
|
|
12
12
|
export function react(config) {
|
|
13
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
14
|
+
|
|
13
15
|
return {
|
|
14
|
-
extends: [...reactConfig, ...(
|
|
15
|
-
files: ["**/*.jsx", "**/*.tsx"],
|
|
16
|
-
...
|
|
16
|
+
extends: [...reactConfig, ...(extendsConfig ?? [])],
|
|
17
|
+
files: ["**/*.jsx", "**/*.tsx", ...(files ?? [])],
|
|
18
|
+
...rest,
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { storybook as storybookPlugin } from "../plugins/storybook.js"
|
|
2
2
|
|
|
3
|
-
export const storybookConfig = [
|
|
4
|
-
storybookPlugin,
|
|
5
|
-
{
|
|
6
|
-
rules: {
|
|
7
|
-
"no-console": "off",
|
|
8
|
-
"react-hooks/rules-of-hooks": "off",
|
|
9
|
-
"react/no-array-index-key": "off",
|
|
10
|
-
"security-node/detect-crlf": "off",
|
|
11
|
-
"unicorn/consistent-function-scoping": "off",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
]
|
|
15
|
-
|
|
16
3
|
/**
|
|
17
4
|
* Storybook ESLint configuration with relaxed rules for story files
|
|
18
5
|
*
|
|
@@ -20,9 +7,29 @@ export const storybookConfig = [
|
|
|
20
7
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
21
8
|
*/
|
|
22
9
|
export function storybook(config) {
|
|
10
|
+
const storybookConfig = [
|
|
11
|
+
storybookPlugin,
|
|
12
|
+
{
|
|
13
|
+
rules: {
|
|
14
|
+
"no-console": "off",
|
|
15
|
+
"react-hooks/rules-of-hooks": "off",
|
|
16
|
+
"react/no-array-index-key": "off",
|
|
17
|
+
"security-node/detect-crlf": "off",
|
|
18
|
+
"unicorn/consistent-function-scoping": "off",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
23
|
+
|
|
23
24
|
return {
|
|
24
|
-
extends: [...storybookConfig, ...(
|
|
25
|
-
files: [
|
|
26
|
-
|
|
25
|
+
extends: [...storybookConfig, ...(extendsConfig ?? [])],
|
|
26
|
+
files: [
|
|
27
|
+
"**/*.stories.js",
|
|
28
|
+
"**/*.stories.ts",
|
|
29
|
+
"**/*.stories.jsx",
|
|
30
|
+
"**/*.stories.tsx",
|
|
31
|
+
...(files ?? []),
|
|
32
|
+
],
|
|
33
|
+
...rest,
|
|
27
34
|
}
|
|
28
35
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import typescriptEslint from "typescript-eslint"
|
|
2
2
|
|
|
3
|
+
/** @type {import("@eslint/config-helpers").Config[]} */
|
|
3
4
|
export const typescriptStrictConfig = [
|
|
4
5
|
{
|
|
5
6
|
plugins: {
|
|
@@ -36,9 +37,11 @@ export const typescriptStrictConfig = [
|
|
|
36
37
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
37
38
|
*/
|
|
38
39
|
export function typescriptStrict(config) {
|
|
40
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
41
|
+
|
|
39
42
|
return {
|
|
40
|
-
extends: [...typescriptStrictConfig, ...(
|
|
41
|
-
files: ["**/*.ts", "**/*.tsx", "**/*.cts", "**/*.mts"],
|
|
42
|
-
...
|
|
43
|
+
extends: [...typescriptStrictConfig, ...(extendsConfig ?? [])],
|
|
44
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.cts", "**/*.mts", ...(files ?? [])],
|
|
45
|
+
...rest,
|
|
43
46
|
}
|
|
44
47
|
}
|
|
@@ -31,9 +31,19 @@ export const typescriptConfig = [
|
|
|
31
31
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
32
32
|
*/
|
|
33
33
|
export function typescript(config) {
|
|
34
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
35
|
+
|
|
34
36
|
return {
|
|
35
|
-
extends: [...typescriptConfig, ...(
|
|
36
|
-
files: [
|
|
37
|
-
|
|
37
|
+
extends: [...typescriptConfig, ...(extendsConfig ?? [])],
|
|
38
|
+
files: [
|
|
39
|
+
"**/*.js",
|
|
40
|
+
"**/*.ts",
|
|
41
|
+
"**/*.tsx",
|
|
42
|
+
"**/*.cjs",
|
|
43
|
+
"**/*.cts",
|
|
44
|
+
"**/*.mts",
|
|
45
|
+
...(files ?? []),
|
|
46
|
+
],
|
|
47
|
+
...rest,
|
|
38
48
|
}
|
|
39
49
|
}
|
|
@@ -9,8 +9,10 @@ export const vitestConfig = [vitestPlugin]
|
|
|
9
9
|
* @returns {import("@eslint/config-helpers").ConfigWithExtends} ESLint config
|
|
10
10
|
*/
|
|
11
11
|
export function vitest(config) {
|
|
12
|
+
const { extends: extendsConfig, files, ...rest } = config ?? {}
|
|
13
|
+
|
|
12
14
|
return {
|
|
13
|
-
extends: [...vitestConfig, ...(
|
|
15
|
+
extends: [...vitestConfig, ...(extendsConfig ?? [])],
|
|
14
16
|
files: [
|
|
15
17
|
"**/*.test.js",
|
|
16
18
|
"**/*.test.ts",
|
|
@@ -22,7 +24,8 @@ export function vitest(config) {
|
|
|
22
24
|
"**/*.int.test.ts",
|
|
23
25
|
"**/*.integration.test.js",
|
|
24
26
|
"**/*.integration.test.ts",
|
|
27
|
+
...(files ?? []),
|
|
25
28
|
],
|
|
26
|
-
...
|
|
29
|
+
...rest,
|
|
27
30
|
}
|
|
28
31
|
}
|
package/src/eslint/index.js
CHANGED
|
@@ -33,6 +33,7 @@ export * from "./configs/node.js"
|
|
|
33
33
|
export * from "./configs/package-json.js"
|
|
34
34
|
export * from "./configs/playwright.js"
|
|
35
35
|
export * from "./configs/react.js"
|
|
36
|
+
export * from "./configs/storybook.js"
|
|
36
37
|
export * from "./configs/typescript.js"
|
|
37
38
|
export * from "./configs/typescript-strict.js"
|
|
38
39
|
export * from "./configs/vitest.js"
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createRequire } from "node:module"
|
|
2
|
+
|
|
3
|
+
let cachedPlugin
|
|
4
|
+
|
|
5
|
+
function getPlugin() {
|
|
6
|
+
if (!cachedPlugin) {
|
|
7
|
+
const require = createRequire(import.meta.url)
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
cachedPlugin = require("eslint-plugin-jest")
|
|
11
|
+
} catch {
|
|
12
|
+
throw new Error(
|
|
13
|
+
"eslint-plugin-jest is required for jest config. " +
|
|
14
|
+
"Install it: npm install -D eslint-plugin-jest",
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return cachedPlugin
|
|
20
|
+
}
|
|
2
21
|
|
|
3
22
|
/** @type {import("@eslint/config-helpers").Config} */
|
|
4
23
|
export const jest = {
|
|
5
|
-
plugins
|
|
6
|
-
jest:
|
|
24
|
+
get plugins() {
|
|
25
|
+
return { jest: getPlugin() }
|
|
7
26
|
},
|
|
8
27
|
rules: {
|
|
9
28
|
"jest/consistent-test-it": ["error", { fn: "test", withinDescribe: "test" }],
|
|
@@ -11,17 +11,16 @@ export const reactHooks = {
|
|
|
11
11
|
"react-hooks/error-boundaries": "error",
|
|
12
12
|
"react-hooks/gating": "error",
|
|
13
13
|
"react-hooks/globals": "error",
|
|
14
|
+
"react-hooks/immutability": "error",
|
|
15
|
+
"react-hooks/incompatible-library": "error",
|
|
16
|
+
"react-hooks/preserve-manual-memoization": "error",
|
|
14
17
|
"react-hooks/purity": "error",
|
|
15
18
|
"react-hooks/refs": "error",
|
|
16
19
|
"react-hooks/rules-of-hooks": "error",
|
|
20
|
+
"react-hooks/set-state-in-effect": "error",
|
|
17
21
|
"react-hooks/set-state-in-render": "error",
|
|
18
22
|
"react-hooks/static-components": "error",
|
|
19
23
|
"react-hooks/unsupported-syntax": "error",
|
|
20
24
|
"react-hooks/use-memo": "error",
|
|
21
|
-
// These should be re enabled some time soon
|
|
22
|
-
// "react-hooks/immutability": "error",
|
|
23
|
-
// "react-hooks/incompatible-library": "error",
|
|
24
|
-
// "react-hooks/preserve-manual-memoization": "error",
|
|
25
|
-
// "react-hooks/set-state-in-effect": "error",
|
|
26
25
|
},
|
|
27
26
|
}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createRequire } from "node:module"
|
|
2
|
+
|
|
3
|
+
let cachedPlugin
|
|
4
|
+
|
|
5
|
+
function getPlugin() {
|
|
6
|
+
if (!cachedPlugin) {
|
|
7
|
+
const require = createRequire(import.meta.url)
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
cachedPlugin = require("eslint-plugin-storybook")
|
|
11
|
+
} catch {
|
|
12
|
+
throw new Error(
|
|
13
|
+
"eslint-plugin-storybook is required for storybook config. " +
|
|
14
|
+
"Install it: npm install -D eslint-plugin-storybook",
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return cachedPlugin
|
|
20
|
+
}
|
|
2
21
|
|
|
3
22
|
/** @type {import("@eslint/config-helpers").Config} */
|
|
4
23
|
export const storybook = {
|
|
5
|
-
plugins
|
|
6
|
-
storybook:
|
|
24
|
+
get plugins() {
|
|
25
|
+
return { storybook: getPlugin() }
|
|
7
26
|
},
|
|
8
27
|
rules: {
|
|
9
28
|
"storybook/await-interactions": "error",
|