@dvukovic/style-guide 0.3.121 → 0.4.1

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.
Files changed (98) hide show
  1. package/dist/.packagerc.d.ts +3 -0
  2. package/dist/.release-it.d.ts +39 -0
  3. package/dist/cspell.config.d.ts +3 -0
  4. package/dist/eslint.config.d.ts +2 -0
  5. package/dist/prettier.config.d.ts +3 -0
  6. package/dist/src/eslint/configs/core.d.ts +8 -0
  7. package/dist/src/eslint/configs/core.test.d.ts +1 -0
  8. package/dist/src/eslint/configs/jest.d.ts +7 -0
  9. package/dist/src/eslint/configs/jest.test.d.ts +1 -0
  10. package/dist/src/eslint/configs/mobx.d.ts +8 -0
  11. package/dist/src/eslint/configs/mobx.test.d.ts +1 -0
  12. package/dist/src/eslint/configs/next.d.ts +8 -0
  13. package/dist/src/eslint/configs/next.test.d.ts +1 -0
  14. package/dist/src/eslint/configs/node.d.ts +8 -0
  15. package/dist/src/eslint/configs/node.test.d.ts +1 -0
  16. package/dist/src/eslint/configs/package-json.d.ts +22 -0
  17. package/dist/src/eslint/configs/package-json.test.d.ts +1 -0
  18. package/dist/src/eslint/configs/playwright.d.ts +8 -0
  19. package/dist/src/eslint/configs/playwright.test.d.ts +1 -0
  20. package/dist/src/eslint/configs/react.d.ts +8 -0
  21. package/dist/src/eslint/configs/react.test.d.ts +1 -0
  22. package/dist/src/eslint/configs/storybook.d.ts +7 -0
  23. package/dist/src/eslint/configs/storybook.test.d.ts +1 -0
  24. package/dist/src/eslint/configs/typescript-strict.d.ts +9 -0
  25. package/dist/src/eslint/configs/typescript-strict.test.d.ts +1 -0
  26. package/dist/src/eslint/configs/typescript.d.ts +20 -0
  27. package/dist/src/eslint/configs/typescript.test.d.ts +1 -0
  28. package/dist/src/eslint/configs/vitest.d.ts +8 -0
  29. package/dist/src/eslint/configs/vitest.test.d.ts +1 -0
  30. package/dist/src/eslint/index.d.ts +20 -0
  31. package/dist/src/eslint/plugins/baseline.d.ts +2 -0
  32. package/dist/src/eslint/plugins/dvukovic.d.ts +2 -0
  33. package/dist/src/eslint/plugins/eslint-comments.d.ts +2 -0
  34. package/dist/src/eslint/plugins/eslint.d.ts +2 -0
  35. package/dist/src/eslint/plugins/eslint.test.d.ts +1 -0
  36. package/dist/src/eslint/plugins/import-x.d.ts +2 -0
  37. package/dist/src/eslint/plugins/jest.d.ts +2 -0
  38. package/dist/src/eslint/plugins/mobx.d.ts +2 -0
  39. package/dist/src/eslint/plugins/n.d.ts +2 -0
  40. package/dist/src/eslint/plugins/next.d.ts +2 -0
  41. package/dist/src/eslint/plugins/package-json.d.ts +2 -0
  42. package/dist/src/eslint/plugins/playwright.d.ts +2 -0
  43. package/dist/src/eslint/plugins/promise.d.ts +2 -0
  44. package/dist/src/eslint/plugins/react-hooks.d.ts +2 -0
  45. package/dist/src/eslint/plugins/react.d.ts +2 -0
  46. package/dist/src/eslint/plugins/rimac.d.ts +2 -0
  47. package/dist/src/eslint/plugins/security-node.d.ts +2 -0
  48. package/dist/src/eslint/plugins/simple-import-sort.d.ts +2 -0
  49. package/dist/src/eslint/plugins/sonarjs.d.ts +2 -0
  50. package/dist/src/eslint/plugins/sort-destructure-keys.d.ts +2 -0
  51. package/dist/src/eslint/plugins/sort-keys-fix.d.ts +2 -0
  52. package/dist/src/eslint/plugins/storybook.d.ts +2 -0
  53. package/dist/src/eslint/plugins/stylistic.d.ts +2 -0
  54. package/dist/src/eslint/plugins/typescript-eslint.d.ts +2 -0
  55. package/dist/src/eslint/plugins/typescript-sort-keys.d.ts +2 -0
  56. package/dist/src/eslint/plugins/unicorn.d.ts +2 -0
  57. package/dist/src/eslint/plugins/unused-imports.d.ts +2 -0
  58. package/dist/src/eslint/plugins/vitest.d.ts +2 -0
  59. package/dist/src/eslint/rules/no-commented-out-code/no-commented-out-code.d.ts +15 -0
  60. package/dist/src/eslint/rules/no-commented-out-code/no-commented-out-code.test.d.ts +1 -0
  61. package/dist/src/eslint/rules/no-commented-out-code/no-commented-out-code.utils.d.ts +10 -0
  62. package/dist/src/eslint/rules/no-restricted-dependencies/no-restricted-dependencies.d.ts +48 -0
  63. package/dist/src/eslint/rules/no-restricted-dependencies/no-restricted-dependencies.test.d.ts +1 -0
  64. package/dist/src/eslint/rules/no-t/no-t.d.ts +25 -0
  65. package/dist/src/eslint/rules/no-t/no-t.test.d.ts +1 -0
  66. package/dist/src/eslint/rules/require-properties/require-properties.d.ts +33 -0
  67. package/dist/src/eslint/rules/require-properties/require-properties.test.d.ts +1 -0
  68. package/dist/src/eslint/rules/valid-engines-node/valid-engines-node.d.ts +27 -0
  69. package/dist/src/eslint/rules/valid-engines-node/valid-engines-node.test.d.ts +1 -0
  70. package/dist/src/prettier/configs/core.d.ts +3 -0
  71. package/dist/src/prettier/configs/core.test.d.ts +1 -0
  72. package/dist/src/prettier/plugins/embed.d.ts +3 -0
  73. package/dist/src/prettier/plugins/prettier.d.ts +3 -0
  74. package/dist/src/prettier/plugins/sql.d.ts +3 -0
  75. package/dist/src/stylelint/configs/core.d.ts +3 -0
  76. package/dist/src/stylelint/configs/core.test.d.ts +1 -0
  77. package/dist/src/stylelint/plugins/no-unused-selectors.d.ts +3 -0
  78. package/dist/src/stylelint/plugins/order.d.ts +3 -0
  79. package/dist/src/stylelint/plugins/stylelint.d.ts +3 -0
  80. package/dist/stylelint.config.d.ts +3 -0
  81. package/dist/vitest.config.d.ts +2 -0
  82. package/package.json +17 -10
  83. package/src/eslint/configs/core.js +13 -3
  84. package/src/eslint/configs/jest.js +6 -4
  85. package/src/eslint/configs/mobx.js +5 -3
  86. package/src/eslint/configs/next.js +5 -3
  87. package/src/eslint/configs/node.js +13 -3
  88. package/src/eslint/configs/package-json.js +13 -6
  89. package/src/eslint/configs/playwright.js +5 -2
  90. package/src/eslint/configs/react.js +5 -3
  91. package/src/eslint/configs/storybook.js +23 -16
  92. package/src/eslint/configs/typescript-strict.js +6 -3
  93. package/src/eslint/configs/typescript.js +13 -3
  94. package/src/eslint/configs/vitest.js +5 -2
  95. package/src/eslint/index.js +1 -0
  96. package/src/eslint/plugins/jest.js +22 -3
  97. package/src/eslint/plugins/react-hooks.js +4 -5
  98. package/src/eslint/plugins/storybook.js +22 -3
@@ -0,0 +1,3 @@
1
+ export default config;
2
+ /** @type {import("npm-package-json-lint/dist/src/configuration").Config} */
3
+ declare const config: any;
@@ -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,3 @@
1
+ export default config;
2
+ /** @type {import("cspell").FileSettings} */
3
+ declare const config: import("cspell").FileSettings;
@@ -0,0 +1,2 @@
1
+ declare const _default: any[];
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { Config } from "prettier";
2
+ declare const config: Config;
3
+ export default config;
@@ -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,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,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const baseline: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const dvukovic: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const eslintComments: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const eslint: import("@eslint/config-helpers").Config;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const importX: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const jest: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const mobx: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const nodeN: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const next: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const packageJson: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const playwright: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const promise: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const reactHooks: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const react: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const rimac: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const securityNode: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const simpleImportSort: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const sonarjs: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const sortDestructureKeys: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const sortKeysFix: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const storybook: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const stylistic: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const typescriptEslint: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const typescriptSortKeys: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const unicorn: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const unusedImports: import("@eslint/config-helpers").Config;
@@ -0,0 +1,2 @@
1
+ /** @type {import("@eslint/config-helpers").Config} */
2
+ export const vitest: import("@eslint/config-helpers").Config;
@@ -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,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,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,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,3 @@
1
+ export default config;
2
+ /** @type {import("prettier").Config} */
3
+ declare const config: import("prettier").Config;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export default plugin;
2
+ /** @type {import("prettier-plugin-embed").PrettierPluginEmbedOptions} */
3
+ declare const plugin: import("prettier-plugin-embed").PrettierPluginEmbedOptions;
@@ -0,0 +1,3 @@
1
+ export default plugin;
2
+ /** @type {import("prettier").Config} */
3
+ declare const plugin: import("prettier").Config;
@@ -0,0 +1,3 @@
1
+ export default plugin;
2
+ /** @type {import("prettier-plugin-sql").SqlBaseOptions} */
3
+ declare const plugin: import("prettier-plugin-sql").SqlBaseOptions;
@@ -0,0 +1,3 @@
1
+ export default config;
2
+ /** @type {import("stylelint").Config} */
3
+ declare const config: import("stylelint").Config;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export default plugin;
2
+ /** @type {import("stylelint").Config} */
3
+ declare const plugin: import("stylelint").Config;
@@ -0,0 +1,3 @@
1
+ export default plugin;
2
+ /** @type {import("stylelint").Config} */
3
+ declare const plugin: import("stylelint").Config;
@@ -0,0 +1,3 @@
1
+ export default plugin;
2
+ /** @type {import("stylelint").Config} */
3
+ declare const plugin: import("stylelint").Config;
@@ -0,0 +1,3 @@
1
+ export default config;
2
+ /** @type {import("stylelint").Config} */
3
+ declare const config: import("stylelint").Config;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvukovic/style-guide",
3
- "version": "0.3.121",
3
+ "version": "0.4.1",
4
4
  "description": "My own style guide",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,14 +11,25 @@
11
11
  "name": "Domagoj Vukovic"
12
12
  },
13
13
  "type": "module",
14
+ "exports": {
15
+ "./cspell/dictionary.txt": "./src/cspell/dictionary.txt",
16
+ "./eslint": {
17
+ "types": "./dist/src/eslint/index.d.ts",
18
+ "default": "./src/eslint/index.js"
19
+ },
20
+ "./prettier": "./src/prettier/index.js",
21
+ "./stylelint": "./src/stylelint/index.js"
22
+ },
14
23
  "files": [
15
- "src/eslint",
24
+ "dist",
16
25
  "src/cspell",
26
+ "src/eslint",
27
+ "src/package-json",
17
28
  "src/prettier",
18
- "src/stylelint",
19
- "src/package-json"
29
+ "src/stylelint"
20
30
  ],
21
31
  "scripts": {
32
+ "build": "tsc",
22
33
  "lint": "yarn lint:eslint && yarn lint:prettier && yarn lint:stylelint && yarn lint:cspell",
23
34
  "lint:cspell": "cspell --no-progress --no-summary --unique '**'",
24
35
  "lint:eslint": "eslint . --cache --concurrency=auto",
@@ -31,6 +42,7 @@
31
42
  "dependencies": {
32
43
  "@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
33
44
  "@eslint/compat": "2.0.0",
45
+ "@eslint/config-helpers": "0.4.2",
34
46
  "@next/eslint-plugin-next": "16.1.0",
35
47
  "@prettier/plugin-xml": "3.4.2",
36
48
  "@rimac-technology/eslint-plugin": "1.5.0",
@@ -71,18 +83,13 @@
71
83
  "typescript-eslint": "8.50.0"
72
84
  },
73
85
  "devDependencies": {
74
- "@storybook/react": "10.1.10",
86
+ "@release-it/conventional-changelog": "10.0.4",
75
87
  "@types/eslint": "9.6.1",
76
- "@types/jest": "30.0.0",
77
88
  "@types/node": "24.10.4",
78
- "@types/react": "19.2.7",
79
89
  "cspell": "9.4.0",
80
90
  "eslint": "9.39.2",
81
- "jest": "30.2.0",
82
91
  "prettier": "3.7.4",
83
- "react": "19.2.3",
84
92
  "release-it": "19.1.0",
85
- "storybook": "10.1.10",
86
93
  "stylelint": "16.26.1",
87
94
  "typescript": "5.9.3",
88
95
  "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, ...(config?.extends ?? [])],
42
- files: ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.ts", "**/*.tsx"],
43
- ...config,
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, ...(config?.extends ?? [])],
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
- ...config,
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, ...(config?.extends ?? [])],
14
- files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
15
- ...config,
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, ...(config?.extends ?? [])],
14
- files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
15
- ...config,
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, ...(config?.extends ?? [])],
15
- files: ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.ts", "**/*.cts", "**/*.mts"],
16
- ...config,
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, ...(config?.extends ?? [])],
16
- files: ["**/package.json"],
17
- ...config,
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 { workspacePatterns = DEFAULT_WORKSPACE_PATTERNS, ...rest } = config ?? {}
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, ...(rest?.extends ?? [])],
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, ...(config?.extends ?? [])],
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
- ...config,
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, ...(config?.extends ?? [])],
15
- files: ["**/*.jsx", "**/*.tsx"],
16
- ...config,
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, ...(config?.extends ?? [])],
25
- files: ["**/*.stories.js", "**/*.stories.ts", "**/*.stories.jsx", "**/*.stories.tsx"],
26
- ...config,
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, ...(config?.extends ?? [])],
41
- files: ["**/*.ts", "**/*.tsx", "**/*.cts", "**/*.mts"],
42
- ...config,
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, ...(config?.extends ?? [])],
36
- files: ["**/*.js", "**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.cts", "**/*.mts"],
37
- ...config,
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, ...(config?.extends ?? [])],
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
- ...config,
29
+ ...rest,
27
30
  }
28
31
  }
@@ -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 plugin from "eslint-plugin-jest"
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: plugin,
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 plugin from "eslint-plugin-storybook"
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: plugin,
24
+ get plugins() {
25
+ return { storybook: getPlugin() }
7
26
  },
8
27
  rules: {
9
28
  "storybook/await-interactions": "error",