@haltcase/style 8.0.0-canary.8 → 8.0.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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -0
  3. package/package.json +151 -172
  4. package/LICENSE.md +0 -382
  5. package/dist/types/eslint/configs/browser.d.ts +0 -8
  6. package/dist/types/eslint/configs/cjs.d.ts +0 -4
  7. package/dist/types/eslint/configs/internal/base.d.ts +0 -76
  8. package/dist/types/eslint/configs/internal/commonjs.d.ts +0 -4
  9. package/dist/types/eslint/configs/internal/es2015.d.ts +0 -4
  10. package/dist/types/eslint/configs/internal/simple-import-sort.d.ts +0 -4
  11. package/dist/types/eslint/configs/internal/tsdoc.d.ts +0 -4
  12. package/dist/types/eslint/configs/internal/unicorn.d.ts +0 -4
  13. package/dist/types/eslint/configs/internal/utils/typescript.d.ts +0 -6
  14. package/dist/types/eslint/configs/next.d.ts +0 -8
  15. package/dist/types/eslint/configs/node.d.ts +0 -8
  16. package/dist/types/eslint/configs/playwright-test.d.ts +0 -4
  17. package/dist/types/eslint/configs/react.d.ts +0 -8
  18. package/dist/types/eslint/configs/typescript.d.ts +0 -10
  19. package/dist/types/eslint/constants.d.ts +0 -14
  20. package/dist/types/eslint/index.d.ts +0 -12
  21. package/dist/types/eslint/rules/best-practice.d.ts +0 -5
  22. package/dist/types/eslint/rules/imports.d.ts +0 -5
  23. package/dist/types/eslint/rules/jsx-a11y.d.ts +0 -5
  24. package/dist/types/eslint/rules/playwright-test.d.ts +0 -8
  25. package/dist/types/eslint/rules/possible-errors.d.ts +0 -8
  26. package/dist/types/eslint/rules/react-x.d.ts +0 -8
  27. package/dist/types/eslint/rules/react.d.ts +0 -11
  28. package/dist/types/eslint/rules/stylistic-jsx.d.ts +0 -8
  29. package/dist/types/eslint/rules/stylistic.d.ts +0 -8
  30. package/dist/types/eslint/rules/typescript/extension.d.ts +0 -5
  31. package/dist/types/eslint/rules/typescript/import.d.ts +0 -5
  32. package/dist/types/eslint/rules/typescript/index.d.ts +0 -8
  33. package/dist/types/eslint/rules/typescript/naming-convention.d.ts +0 -5
  34. package/dist/types/eslint/rules/variables.d.ts +0 -8
  35. package/dist/types/eslint/withFiles.d.ts +0 -2
  36. package/dist/types/prettier/index.d.ts +0 -12
  37. package/dist/types/stylelint/_base.d.ts +0 -1
  38. package/dist/types/stylelint/index.d.ts +0 -2
  39. package/dist/types/stylelint/modules.d.ts +0 -2
  40. package/dist/types/stylelint/standard.d.ts +0 -1
  41. package/dist/types/stylelint/tailwind.d.ts +0 -2
  42. package/eslint/configs/browser.js +0 -27
  43. package/eslint/configs/cjs.js +0 -13
  44. package/eslint/configs/internal/base.js +0 -205
  45. package/eslint/configs/internal/commonjs.js +0 -22
  46. package/eslint/configs/internal/es2015.js +0 -72
  47. package/eslint/configs/internal/simple-import-sort.js +0 -27
  48. package/eslint/configs/internal/tsdoc.js +0 -20
  49. package/eslint/configs/internal/unicorn.js +0 -750
  50. package/eslint/configs/internal/utils/typescript.js +0 -53
  51. package/eslint/configs/next.js +0 -54
  52. package/eslint/configs/node.js +0 -27
  53. package/eslint/configs/playwright-test.js +0 -21
  54. package/eslint/configs/react.js +0 -114
  55. package/eslint/configs/typescript.js +0 -125
  56. package/eslint/constants.js +0 -27
  57. package/eslint/index.js +0 -33
  58. package/eslint/rules/best-practice.js +0 -256
  59. package/eslint/rules/imports.js +0 -94
  60. package/eslint/rules/jsx-a11y.js +0 -21
  61. package/eslint/rules/playwright-test.js +0 -27
  62. package/eslint/rules/possible-errors.js +0 -40
  63. package/eslint/rules/react-x.js +0 -78
  64. package/eslint/rules/react.js +0 -24
  65. package/eslint/rules/stylistic-jsx.js +0 -17
  66. package/eslint/rules/stylistic.js +0 -85
  67. package/eslint/rules/typescript/extension.js +0 -74
  68. package/eslint/rules/typescript/import.js +0 -23
  69. package/eslint/rules/typescript/index.js +0 -114
  70. package/eslint/rules/typescript/naming-convention.js +0 -121
  71. package/eslint/rules/variables.js +0 -36
  72. package/eslint/withFiles.js +0 -15
  73. package/prettier/index.js +0 -39
  74. package/readme.md +0 -415
  75. package/stylelint/_base.js +0 -45
  76. package/stylelint/index.js +0 -20
  77. package/stylelint/modules.js +0 -32
  78. package/stylelint/standard.js +0 -4
  79. package/stylelint/tailwind.js +0 -16
  80. package/typescript/tsconfig.base.json +0 -14
  81. package/typescript/tsconfig.bundler.json +0 -17
  82. package/typescript/tsconfig.next.json +0 -36
  83. package/typescript/tsconfig.node-ts.json +0 -10
  84. package/typescript/tsconfig.node.json +0 -4
  85. package/typescript/tsconfig.node18.json +0 -10
  86. package/typescript/tsconfig.node20.json +0 -11
  87. package/typescript/tsconfig.node22.json +0 -11
  88. package/typescript/tsconfig.node24.json +0 -17
  89. package/typescript/tsconfig.web.json +0 -8
@@ -1,74 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- import { variablesRules } from "../variables.js";
6
-
7
- // These share identical configuration options, so we want to keep them in sync.
8
- // eslint-disable-next-line unicorn/prevent-abbreviations
9
- const noUnusedVarsOptions = variablesRules["no-unused-vars"];
10
-
11
- /**
12
- * @type {Linter.RulesRecord}
13
- */
14
- export const typescriptExtensionRules = {
15
- /**
16
- * Require default parameters to be last.
17
- *
18
- * 🚫 Not fixable - https://typescript-eslint.io/rules/default-param-last/
19
- */
20
- "@typescript-eslint/default-param-last": "error",
21
- /**
22
- * Disallow accidentally using the "empty object" type (`{}`).
23
- *
24
- * 🔧 Partially fixable - https://typescript-eslint.io/rules/no-empty-object-type/
25
- */
26
- "@typescript-eslint/no-empty-object-type": [
27
- "error",
28
- {
29
- // allow "single-extends" interfaces as they are often useful for
30
- // documentation purposes and future extensibility
31
- allowInterfaces: "with-single-extends",
32
- // allow React-like props types
33
- allowWithName: "Props$"
34
- }
35
- ],
36
- /**
37
- * Disallow creation of functions within loops.
38
- *
39
- * 🚫 Not fixable - https://typescript-eslint.io/rules/no-loop-func/
40
- */
41
- "@typescript-eslint/no-loop-func": "error",
42
- /**
43
- * Disallow variable declarations from shadowing variables declared in the
44
- * outer scope.
45
- *
46
- * 🚫 Not fixable - https://typescript-eslint.io/rules/no-shadow/
47
- */
48
- "@typescript-eslint/no-shadow": "error",
49
- /**
50
- * Disallow unused variables.
51
- *
52
- * 🚫 Not fixable - https://typescript-eslint.io/rules/no-unused-vars/
53
- */
54
- "@typescript-eslint/no-unused-vars": noUnusedVarsOptions,
55
- /**
56
- * Disallow unnecessary constructors.
57
- *
58
- * 🚫 Not fixable - https://typescript-eslint.io/rules/no-useless-constructor/
59
- */
60
- "@typescript-eslint/no-useless-constructor": "error",
61
- /**
62
- * Enforce template literal expressions to be of string type.
63
- *
64
- * 🚫 Not fixable - https://typescript-eslint.io/rules/restrict-template-expressions/
65
- */
66
- "@typescript-eslint/restrict-template-expressions": [
67
- "error",
68
- {
69
- allow: [{ from: "lib", name: ["Error", "URL", "URLSearchParams"] }],
70
- allowBoolean: true,
71
- allowNumber: true
72
- }
73
- ]
74
- };
@@ -1,23 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * These are enabled by `import-x/recommended`, but are better handled by
7
- * TypeScript and `typescript-eslint`.
8
- *
9
- * @type {Linter.RulesRecord}
10
- */
11
- const disabledRules = {
12
- "import-x/default": "off",
13
- "import-x/export": "off",
14
- "import-x/namespace": "off",
15
- "import-x/no-unresolved": "off"
16
- };
17
-
18
- /**
19
- * @type {Linter.RulesRecord}
20
- */
21
- export const typescriptImportRules = {
22
- ...disabledRules
23
- };
@@ -1,114 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- export const typescriptBaseRules = {
9
- /**
10
- * Require consistent usage of type exports.
11
- *
12
- * 🔧 Fixable - https://typescript-eslint.io/rules/consistent-type-exports/
13
- */
14
- "@typescript-eslint/consistent-type-exports": [
15
- "warn",
16
- { fixMixedExportsWithInlineTypeSpecifier: true }
17
- ],
18
- /**
19
- * Require consistent usage of type imports.
20
- *
21
- * 🔧 Fixable - https://typescript-eslint.io/rules/consistent-type-imports/
22
- */
23
- "@typescript-eslint/consistent-type-imports": "warn",
24
- /**
25
- * Require explicit return types on functions and class methods.
26
- *
27
- * 🚫 Not fixable - https://typescript-eslint.io/rules/explicit-function-return-type/
28
- */
29
- "@typescript-eslint/explicit-function-return-type": [
30
- "warn",
31
- {
32
- allowExpressions: true,
33
- allowFunctionsWithoutTypeParameters: true,
34
- allowTypedFunctionExpressions: true
35
- }
36
- ],
37
- /**
38
- * Require using function property types in method signatures.
39
- *
40
- * These have enhanced typechecking, whereas method signatures do not.
41
- *
42
- * 🔧 Fixable - https://typescript-eslint.io/rules/method-signature-style/
43
- */
44
- "@typescript-eslint/method-signature-style": "warn",
45
- /**
46
- * Prevent `void` type expressions from being used in misleading locations
47
- * such as being assigned to a variable, provided as a function argument,
48
- * or returned from a function (except concise arrow functions).
49
- *
50
- * 🔧 Fixable - https://typescript-eslint.io/rules/no-confusing-void-expression/
51
- */
52
- "@typescript-eslint/no-confusing-void-expression": [
53
- "error",
54
- {
55
- ignoreArrowShorthand: true
56
- }
57
- ],
58
- /**
59
- * Disallow Promises in places not designed to handle them.
60
- *
61
- * Function arguments and JSX attributes are allowed.
62
- *
63
- * 🚫 Not fixable - https://typescript-eslint.io/rules/no-misused-promises
64
- */
65
- "@typescript-eslint/no-misused-promises": [
66
- "error",
67
- {
68
- checksVoidReturn: {
69
- arguments: false,
70
- attributes: false
71
- }
72
- }
73
- ],
74
- /**
75
- * Disallow members of unions and intersections that do nothing or override type information.
76
- *
77
- * 🚫 Not fixable - https://typescript-eslint.io/rules/no-redundant-type-constituents/
78
- */
79
- "@typescript-eslint/no-redundant-type-constituents": "warn",
80
- /**
81
- * Disallow unnecessary namespace qualifiers.
82
- *
83
- * 🔧 Fixable - https://typescript-eslint.io/rules/no-unnecessary-qualifier/
84
- */
85
- "@typescript-eslint/no-unnecessary-qualifier": "warn",
86
- /**
87
- * Enforce using the nullish coalescing operator instead of logical assignments or chaining.
88
- *
89
- * 🔧 Fixable - https://typescript-eslint.io/rules/prefer-nullish-coalescing/
90
- */
91
- "@typescript-eslint/prefer-nullish-coalescing": [
92
- "error",
93
- {
94
- ignorePrimitives: {
95
- number: true,
96
- string: true
97
- }
98
- }
99
- ],
100
- /**
101
- * Require using `RegExp.exec()` over `String.match()` for consistency.
102
- *
103
- * 🔧 Fixable - https://typescript-eslint.io/rules/prefer-regexp-exec/
104
- */
105
- "@typescript-eslint/prefer-regexp-exec": "warn",
106
- /**
107
- * Require exhaustive checks when using union types in switch statements.
108
- *
109
- * This ensures cases are considered when items are later added to a union.
110
- *
111
- * 🚫 Not fixable - https://typescript-eslint.io/rules/switch-exhaustiveness-check/
112
- */
113
- "@typescript-eslint/switch-exhaustiveness-check": "error"
114
- };
@@ -1,121 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @param {object} [options]
7
- * @param {boolean} [options.isComponentLike = false] - Whether to treat as component-like (e.g., themed components without TSX/JSX).
8
- * @param {boolean} [options.isTsx = false] - Whether to lint as TSX (JSX).
9
- * @returns {Linter.RulesRecord}
10
- */
11
- export const getTypescriptNamingConventionRule = ({
12
- isComponentLike = false,
13
- isTsx = false
14
- } = {}) => ({
15
- /**
16
- * Require consistent naming conventions.
17
- *
18
- * Improves IntelliSense suggestions and avoids name collisions.
19
- *
20
- * 🚫 Not fixable - https://typescript-eslint.io/rules/naming-convention/
21
- */
22
- "@typescript-eslint/naming-convention": [
23
- "error",
24
- // enforce that unused variable-likes are prefixed with `_`
25
- {
26
- format: [
27
- "camelCase",
28
- (isComponentLike || isTsx) && "StrictPascalCase"
29
- ].filter(Boolean),
30
- leadingUnderscore: "require",
31
- modifiers: ["unused"],
32
- selector: "variableLike",
33
- trailingUnderscore: "forbid"
34
- },
35
- // enforce that everything is camelCase by default
36
- {
37
- format: [
38
- "camelCase",
39
- (isComponentLike || isTsx) && "StrictPascalCase"
40
- ].filter(Boolean),
41
- leadingUnderscore: "forbid",
42
- selector: "default",
43
- trailingUnderscore: "forbid"
44
- },
45
- // allow HTTP methods in UPPER_CASE
46
- {
47
- filter: {
48
- match: true,
49
- regex: "^(ALL|GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)$"
50
- },
51
- format: null,
52
- selector: ["variableLike", "memberLike"]
53
- },
54
- // allow variable-likes called exactly "_"
55
- {
56
- filter: {
57
- match: true,
58
- regex: "^_$"
59
- },
60
- format: null,
61
- selector: ["variableLike", "typeProperty"]
62
- },
63
- // anything type-like must be written in PascalCase
64
- {
65
- format: ["PascalCase"],
66
- leadingUnderscore: "forbid",
67
- selector: ["typeLike", "enumMember"],
68
- trailingUnderscore: "forbid"
69
- },
70
- // interfaces must not be prefixed with `I` or have restricted names
71
- {
72
- custom: {
73
- match: false,
74
- regex: "^I[A-Z]|^(Interface|Props|State)$"
75
- },
76
- format: ["PascalCase"],
77
- selector: "interface"
78
- },
79
- // allow leading underscore(s) in object properties for things like brand identifiers
80
- {
81
- format: null,
82
- leadingUnderscore: "allowSingleOrDouble",
83
- selector: "objectLiteralProperty",
84
- trailingUnderscore: "forbid"
85
- },
86
- // booleans must be prefixed with an allowed verb
87
- // https://typescript-eslint.io/rules/naming-convention/#enforce-that-boolean-variables-are-prefixed-with-an-allowed-verb
88
- {
89
- format: ["PascalCase"],
90
- leadingUnderscore: "forbid",
91
- prefix: ["is", "has", "should", "can", "did", "will"],
92
- selector: "variable",
93
- trailingUnderscore: "forbid",
94
- types: ["boolean"]
95
- },
96
- // ignore destructured properties (which are often out of our control)
97
- {
98
- format: null,
99
- modifiers: ["destructured"],
100
- prefix: [],
101
- selector: ["variable", "parameter"]
102
- },
103
- // ignore destructured booleans; requires enough specificity to override
104
- // the above rule enforcing prefixes
105
- {
106
- format: null,
107
- leadingUnderscore: "forbid",
108
- modifiers: ["destructured"],
109
- prefix: [],
110
- selector: "variable",
111
- trailingUnderscore: "forbid",
112
- types: ["boolean"]
113
- },
114
- // enforce that all type parameters begin with `T`
115
- {
116
- format: ["PascalCase"],
117
- prefix: ["T"],
118
- selector: "typeParameter"
119
- }
120
- ]
121
- });
@@ -1,36 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- export const variablesRules = {
9
- /**
10
- * Disallow labels that share a name with a variable.
11
- *
12
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var
13
- */
14
- "no-label-var": "error",
15
- /**
16
- * Disallow initializing variables to `undefined`.
17
- *
18
- * 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init
19
- */
20
- "no-undef-init": "warn",
21
- /**
22
- * Disallow unused variables.
23
- *
24
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-unused-vars
25
- */
26
- "no-unused-vars": [
27
- "error",
28
- {
29
- args: "after-used",
30
- argsIgnorePattern: "^_",
31
- ignoreRestSiblings: true,
32
- vars: "all",
33
- varsIgnorePattern: "^_"
34
- }
35
- ]
36
- };
@@ -1,15 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- *
7
- * @param {Linter.Config[]} configArray
8
- * @param {string[]} files
9
- * @returns {Linter.Config[]}
10
- */
11
- export const withFiles = (configArray, files) =>
12
- configArray.map((config) => ({
13
- ...config,
14
- files
15
- }));
package/prettier/index.js DELETED
@@ -1,39 +0,0 @@
1
- /* eslint-disable import-x/no-default-export */
2
-
3
- import { fileURLToPath } from "node:url";
4
-
5
- /**
6
- * Some of Prettier's defaults can be overridden by an EditorConfig file. We
7
- * define those here to ensure that doesn't happen.
8
- *
9
- * See: https://prettier.io/docs/en/configuration#editorconfig
10
- *
11
- * @satisfies {import("prettier").Options}
12
- */
13
- const overridableDefaults = {
14
- endOfLine: "lf",
15
- printWidth: 80,
16
- tabWidth: 2,
17
- useTabs: true
18
- };
19
-
20
- /**
21
- * @param {string} specifier - The plugin's package name.
22
- */
23
- const resolvePlugin = (specifier) =>
24
- fileURLToPath(import.meta.resolve(specifier));
25
-
26
- /**
27
- * @satisfies {import("prettier").Options}
28
- */
29
- export default {
30
- ...overridableDefaults,
31
- singleQuote: false,
32
- trailingComma: "none",
33
- plugins: [
34
- resolvePlugin("prettier-plugin-packagejson"),
35
- resolvePlugin("prettier-plugin-tailwindcss")
36
- ],
37
- tailwindAttributes: ["classNames"],
38
- tailwindFunctions: ["clsx", "cn", "cx", "twMerge"]
39
- };