@infernodesign/eslint-config 1.18.0 → 1.19.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.
package/README.md CHANGED
@@ -174,13 +174,11 @@ export default config( {
174
174
  // Type of the project. 'lib' for libraries, the default is 'app'
175
175
  type: 'lib',
176
176
 
177
- // Enable stylistic formatting rules
178
- // stylistic: true,
179
-
180
- // Or customize the stylistic rules
177
+ // Customize the stylistic rules
181
178
  stylistic: {
182
179
  indent: 2, // 4, or 'tab'
183
180
  quotes: 'single', // or 'double'
181
+ spacing: false, // Defaults to true (spacing for parenthesis, objects, arrays, etc.)
184
182
  },
185
183
 
186
184
  // TypeScript and Vue are autodetected, you can also explicitly enable them:
@@ -819,18 +817,6 @@ This project follows [Semantic Versioning](https://semver.org/) for releases. Ho
819
817
 
820
818
  You can opt-in to the [`formatters`](#formatters) feature to format your CSS. Note that it's only doing formatting, but not linting. If you want proper linting support, give [`stylelint`](https://stylelint.io/) a try.
821
819
 
822
- ### Top-level Function Style, etc
823
-
824
- If you want to disable the opinionated rules, you can disable them with:
825
-
826
- ```ts
827
- import { config } from '@infernodesign/eslint-config'
828
-
829
- export default config( {
830
- lessOpinionated: true
831
- } )
832
- ```
833
-
834
820
  ## License
835
821
 
836
822
  Licensed under the [MIT License](./LICENSE).
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
9
9
  import { execSync } from "node:child_process";
10
10
 
11
11
  //#region package.json
12
- var version = "1.18.0";
12
+ var version = "1.19.1";
13
13
 
14
14
  //#endregion
15
15
  //#region src/cli/constants.ts
package/dist/index.d.ts CHANGED
@@ -18353,7 +18353,6 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
18353
18353
  jsonc?: boolean | OptionsOverrides;
18354
18354
  jsdoc?: boolean | OptionsOverrides | OptionsProjectType | OptionsStylistic;
18355
18355
  jsx?: boolean | OptionsJSX;
18356
- lessOpinionated?: boolean;
18357
18356
  markdown?: boolean | OptionsOverrides;
18358
18357
  nextjs?: boolean | OptionsNextjs | OptionsOverrides;
18359
18358
  overrides?: {
@@ -18474,7 +18473,9 @@ interface OptionsVue extends OptionsOverrides {
18474
18473
  vueVersion?: 2 | 3;
18475
18474
  }
18476
18475
  type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
18477
- interface StylisticConfig extends Pick<StylisticCustomizeOptions, 'arrowParens' | 'blockSpacing' | 'braceStyle' | 'commaDangle' | 'experimental' | 'indent' | 'jsx' | 'quoteProps' | 'quotes' | 'semi'> {}
18476
+ interface StylisticConfig extends Pick<StylisticCustomizeOptions, 'arrowParens' | 'blockSpacing' | 'braceStyle' | 'commaDangle' | 'experimental' | 'indent' | 'jsx' | 'quoteProps' | 'quotes' | 'semi'> {
18477
+ spacing?: boolean;
18478
+ }
18478
18479
  type TypedFlatConfigItem = Omit<ConfigWithExtends, 'plugins' | 'rules'> & {
18479
18480
  plugins?: Record<string, any>;
18480
18481
  rules?: Rules;
@@ -18572,10 +18573,7 @@ declare function storybook(options?: OptionsFiles & OptionsOverrides): Promise<T
18572
18573
  //#endregion
18573
18574
  //#region src/configs/stylistic.d.ts
18574
18575
  declare const StylisticConfigDefaults: StylisticConfig;
18575
- interface StylisticOptions extends OptionsOverrides, StylisticConfig {
18576
- lessOpinionated?: boolean;
18577
- }
18578
- declare function stylistic(options?: StylisticOptions): Promise<TypedFlatConfigItem[]>;
18576
+ declare function stylistic(options?: OptionsOverrides & StylisticConfig): Promise<TypedFlatConfigItem[]>;
18579
18577
  //#endregion
18580
18578
  //#region src/configs/svelte.d.ts
18581
18579
  declare function svelte(options?: OptionsFiles & OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
@@ -18682,4 +18680,4 @@ declare function renamePluginInConfigs(configs: TypedFlatConfigItem[], map: Reco
18682
18680
  declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
18683
18681
  declare function toArray<T>(value: T | T[]): T[];
18684
18682
  //#endregion
18685
- export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsNextjs, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTailwindcss, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, PACKAGE_NAME, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, config, config as inferno, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
18683
+ export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsNextjs, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTailwindcss, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, PACKAGE_NAME, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, astro, combine, command, comments, config, config as inferno, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -486,7 +486,7 @@ const StylisticConfigDefaults = {
486
486
  semi: false
487
487
  };
488
488
  async function stylistic(options = {}) {
489
- const { arrowParens, braceStyle, commaDangle, indent, jsx, lessOpinionated = false, overrides = {}, quoteProps, quotes, semi } = {
489
+ const { arrowParens, braceStyle, commaDangle, indent, jsx, spacing = true, overrides = {}, quoteProps, quotes, semi } = {
490
490
  ...StylisticConfigDefaults,
491
491
  ...options
492
492
  };
@@ -513,79 +513,90 @@ async function stylistic(options = {}) {
513
513
  ...config.rules,
514
514
  "antfu/consistent-chaining": "error",
515
515
  "antfu/consistent-list-newline": "error",
516
- ...lessOpinionated ? { curly: ["error", "all"] } : {
517
- "antfu/curly": "error",
518
- "antfu/if-newline": "error",
519
- "style/array-bracket-spacing": ["error", "always"],
520
- "style/arrow-parens": ["error", "as-needed"],
521
- "style/arrow-spacing": ["error", {
522
- after: true,
523
- before: true
524
- }],
525
- "style/block-spacing": ["error", "always"],
526
- "style/brace-style": ["error", "1tbs"],
527
- "style/comma-spacing": ["error", {
528
- after: true,
529
- before: false
530
- }],
531
- "style/computed-property-spacing": ["error", "never"],
532
- "style/function-call-spacing": ["error", "never"],
533
- "style/generator-star-spacing": ["error", {
534
- after: true,
535
- before: false
536
- }],
537
- "style/jsx-closing-bracket-location": ["error", "tag-aligned"],
538
- "style/jsx-curly-spacing": ["error", {
539
- children: true,
540
- when: "never"
541
- }],
542
- "style/jsx-equals-spacing": ["error", "never"],
543
- "style/jsx-one-expression-per-line": "off",
544
- "style/jsx-quotes": ["error", "prefer-double"],
545
- "style/jsx-tag-spacing": ["error", {
546
- beforeSelfClosing: "always",
547
- closingSlash: "never"
548
- }],
549
- "style/max-len": "off",
550
- "style/multiline-ternary": "off",
551
- "style/no-mixed-spaces-and-tabs": "error",
552
- "style/no-multi-spaces": ["error", { ignoreEOLComments: true }],
553
- "style/no-trailing-spaces": ["error", { skipBlankLines: true }],
554
- "style/object-curly-spacing": ["error", "always"],
555
- "style/quotes": [
516
+ "curly": ["error", "all"],
517
+ "style/arrow-parens": ["error", "as-needed"],
518
+ "style/arrow-spacing": ["error", {
519
+ after: true,
520
+ before: true
521
+ }],
522
+ "style/block-spacing": ["error", "always"],
523
+ "style/brace-style": ["error", "1tbs"],
524
+ "style/comma-spacing": ["error", {
525
+ after: true,
526
+ before: false
527
+ }],
528
+ "style/computed-property-spacing": ["error", "never"],
529
+ "style/function-call-spacing": ["error", "never"],
530
+ "style/generator-star-spacing": ["error", {
531
+ after: true,
532
+ before: false
533
+ }],
534
+ "style/jsx-closing-bracket-location": ["error", "tag-aligned"],
535
+ "style/jsx-curly-spacing": ["error", {
536
+ children: true,
537
+ when: "never"
538
+ }],
539
+ "style/jsx-equals-spacing": ["error", "never"],
540
+ "style/jsx-one-expression-per-line": "off",
541
+ "style/jsx-quotes": ["error", "prefer-double"],
542
+ "style/jsx-tag-spacing": ["error", {
543
+ beforeSelfClosing: "always",
544
+ closingSlash: "never"
545
+ }],
546
+ "style/max-len": "off",
547
+ "style/multiline-ternary": "off",
548
+ "style/no-mixed-spaces-and-tabs": "error",
549
+ "style/no-multi-spaces": ["error", { ignoreEOLComments: true }],
550
+ "style/no-trailing-spaces": ["error", { skipBlankLines: true }],
551
+ "style/quotes": [
552
+ "error",
553
+ "single",
554
+ { avoidEscape: true }
555
+ ],
556
+ "style/rest-spread-spacing": ["error", "never"],
557
+ "style/space-before-blocks": ["error", "always"],
558
+ "style/space-before-function-paren": ["error", {
559
+ "anonymous": "never",
560
+ "asyncArrow": "always",
561
+ "catch": "never",
562
+ "named": "never"
563
+ }],
564
+ "style/space-infix-ops": ["error", { int32Hint: false }],
565
+ "style/space-unary-ops": ["error", {
566
+ nonwords: false,
567
+ words: true
568
+ }],
569
+ "style/spaced-comment": ["error", "always"],
570
+ "style/switch-colon-spacing": ["error", {
571
+ after: true,
572
+ before: false
573
+ }],
574
+ "style/template-tag-spacing": ["error", "never"],
575
+ "style/type-annotation-spacing": "off",
576
+ "style/type-generic-spacing": "off",
577
+ "style/type-named-tuple-spacing": ["error"],
578
+ "style/wrap-iife": ["error", "outside"],
579
+ "style/yield-star-spacing": ["error", {
580
+ after: true,
581
+ before: false
582
+ }],
583
+ ...!spacing ? {
584
+ "style/array-bracket-spacing": ["error", "never"],
585
+ "style/object-curly-spacing": [
556
586
  "error",
557
- "single",
558
- { avoidEscape: true }
587
+ "never",
588
+ { overrides: {
589
+ ImportAttributes: "always",
590
+ ImportDeclaration: "always",
591
+ ExportAllDeclaration: "always",
592
+ ExportNamedDeclaration: "always"
593
+ } }
559
594
  ],
560
- "style/rest-spread-spacing": ["error", "never"],
561
- "style/space-before-blocks": ["error", "always"],
562
- "style/space-before-function-paren": ["error", {
563
- "anonymous": "never",
564
- "asyncArrow": "always",
565
- "catch": "never",
566
- "named": "never"
567
- }],
568
- "style/space-in-parens": ["error", "always"],
569
- "style/space-infix-ops": ["error", { int32Hint: false }],
570
- "style/space-unary-ops": ["error", {
571
- nonwords: false,
572
- words: true
573
- }],
574
- "style/spaced-comment": ["error", "always"],
575
- "style/switch-colon-spacing": ["error", {
576
- after: true,
577
- before: false
578
- }],
579
- "style/template-curly-spacing": ["error", "never"],
580
- "style/template-tag-spacing": ["error", "never"],
581
- "style/type-annotation-spacing": "off",
582
- "style/type-generic-spacing": "off",
583
- "style/type-named-tuple-spacing": ["error"],
584
- "style/wrap-iife": ["error", "outside"],
585
- "style/yield-star-spacing": ["error", {
586
- after: true,
587
- before: false
588
- }]
595
+ "style/space-in-parens": ["error", "never"]
596
+ } : {
597
+ "style/array-bracket-spacing": ["error", "always"],
598
+ "style/object-curly-spacing": ["error", "always"],
599
+ "style/space-in-parens": ["error", "always"]
589
600
  },
590
601
  ...overrides
591
602
  }
@@ -2410,7 +2421,7 @@ async function tailwindcss(options = {}) {
2410
2421
  ...isUsingEntryPoint ? {
2411
2422
  "tailwindcss/no-conflicting-classes": ["error", { entryPoint: resolvedEntryPointPath }],
2412
2423
  "tailwindcss/no-deprecated-classes": ["error", { entryPoint: resolvedEntryPointPath }],
2413
- "tailwindcss/no-unknown-classes": ["error", { entryPoint: resolvedEntryPointPath }],
2424
+ "tailwindcss/no-unknown-classes": "off",
2414
2425
  "tailwindcss/enforce-canonical-classes": ["error", { entryPoint: resolvedEntryPointPath }],
2415
2426
  "tailwindcss/enforce-consistent-class-order": ["error", { entryPoint: resolvedEntryPointPath }]
2416
2427
  } : {
@@ -3169,7 +3180,6 @@ function config(options = {}, ...userConfigs) {
3169
3180
  }));
3170
3181
  if (stylisticOptions) configs.push(stylistic({
3171
3182
  ...stylisticOptions,
3172
- lessOpinionated: options.lessOpinionated,
3173
3183
  overrides: getOverrides(options, "stylistic")
3174
3184
  }));
3175
3185
  if (enableRegexp) configs.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infernodesign/eslint-config",
3
3
  "description": "ESLint config for Inferno Design.",
4
- "version": "1.18.0",
4
+ "version": "1.19.1",
5
5
  "type": "module",
6
6
  "author": "Inferno Design <support@infernodesign.com>",
7
7
  "license": "MIT",
@@ -56,6 +56,7 @@
56
56
  "@stylistic/eslint-plugin": "5.8.0",
57
57
  "@typescript-eslint/eslint-plugin": "8.55.0",
58
58
  "@typescript-eslint/parser": "8.55.0",
59
+ "@typescript-eslint/utils": "8.55.0",
59
60
  "@vitest/eslint-plugin": "1.6.7",
60
61
  "ansis": "4.2.0",
61
62
  "cac": "6.7.14",