@haltcase/style 8.0.0-canary.3 → 8.0.0-canary.6

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.
@@ -15,6 +15,7 @@
15
15
  * @property {boolean} [nextjs] Whether to include Next.js rules (implies `react`).
16
16
  * @property {boolean} [node] Whether to include Node.js rules.
17
17
  * @property {boolean} [react] Whether to include React rules.
18
+ * @property {string[]} [typescriptComponentPaths] Additional paths to consider as TypeScript component files.
18
19
  * @property {TypeScriptProjectOptions} [typescriptProject] Custom TypeScript project options for
19
20
  * the `typescript-eslint` parser and `eslint-import-resolver-typescript`.
20
21
  */
@@ -61,6 +62,10 @@ export type HaltcaseStyleOptions = {
61
62
  * Whether to include React rules.
62
63
  */
63
64
  react?: boolean | undefined;
65
+ /**
66
+ * Additional paths to consider as TypeScript component files.
67
+ */
68
+ typescriptComponentPaths?: string[] | undefined;
64
69
  /**
65
70
  * Custom TypeScript project options for
66
71
  * the `typescript-eslint` parser and `eslint-import-resolver-typescript`.
@@ -49,6 +49,7 @@ import { prepareTypeScriptProjectConfig } from "./utils/typescript.js";
49
49
  * @property {boolean} [nextjs] Whether to include Next.js rules (implies `react`).
50
50
  * @property {boolean} [node] Whether to include Node.js rules.
51
51
  * @property {boolean} [react] Whether to include React rules.
52
+ * @property {string[]} [typescriptComponentPaths] Additional paths to consider as TypeScript component files.
52
53
  * @property {TypeScriptProjectOptions} [typescriptProject] Custom TypeScript project options for
53
54
  * the `typescript-eslint` parser and `eslint-import-resolver-typescript`.
54
55
  */
@@ -119,6 +119,12 @@ export const eslintUnicornConfig = config({
119
119
  * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
120
120
  */
121
121
  "unicorn/no-array-reduce": "off",
122
+ /**
123
+ * Prefer `Array#toReversed()` over `Array#reverse()`.
124
+ *
125
+ * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reverse.md
126
+ */
127
+ "unicorn/no-array-reverse": "error",
122
128
  /**
123
129
  * Disallow member access from await expression.
124
130
  *
@@ -289,6 +295,12 @@ export const eslintUnicornConfig = config({
289
295
  * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md
290
296
  */
291
297
  "unicorn/no-unused-properties": "error",
298
+ /**
299
+ * Disallow unnecessary `Error.captureStackTrace(…)`.
300
+ *
301
+ * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-error-capture-stack-trace.md
302
+ */
303
+ "unicorn/no-useless-error-capture-stack-trace": "error",
292
304
  /**
293
305
  * Disallow useless fallback when spreading in object literals.
294
306
  *
@@ -391,6 +403,12 @@ export const eslintUnicornConfig = config({
391
403
  * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
392
404
  */
393
405
  "unicorn/prefer-blob-reading-methods": "error",
406
+ /**
407
+ * Prefer class field declarations over `this` assignments in constructors.
408
+ *
409
+ * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-class-fields.md
410
+ */
411
+ "unicorn/prefer-class-fields": "error",
394
412
  /**
395
413
  * Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
396
414
  *
@@ -677,6 +695,12 @@ export const eslintUnicornConfig = config({
677
695
  * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
678
696
  */
679
697
  "unicorn/require-array-join-separator": "error",
698
+ /**
699
+ * Require non-empty specifier list in import and export statements.
700
+ *
701
+ * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-module-specifiers.md
702
+ */
703
+ "unicorn/require-module-specifiers": "error",
680
704
  /**
681
705
  * Enforce using the digits argument with `Number#toFixed()`.
682
706
  *
@@ -11,6 +11,10 @@ import { getEslintBaseConfig } from "./internal/base.js";
11
11
  import { getEslintNodeConfigInternal } from "./node.js";
12
12
  import { getEslintReactConfigInternal } from "./react.js";
13
13
 
14
+ // Remove this when `@next/eslint-plugin-next` is ESM and typed properly
15
+ // eslint-disable-next-line import-x/no-named-as-default-member
16
+ const nextJsConfigs = pluginNextjs.configs;
17
+
14
18
  /**
15
19
  * @type {import("./internal/base.js").HaltcaseStyleCreator}
16
20
  */
@@ -35,8 +39,8 @@ export const getEslintNextConfigInternal = (options = {}) =>
35
39
  "@next/next": pluginNextjs
36
40
  },
37
41
  rules: {
38
- ...pluginNextjs.configs.recommended.rules,
39
- ...pluginNextjs.configs["core-web-vitals"].rules
42
+ ...nextJsConfigs.recommended.rules,
43
+ ...nextJsConfigs["core-web-vitals"].rules
40
44
  }
41
45
  },
42
46
  {
@@ -105,7 +105,10 @@ export const getEslintTypescriptConfigInternal = (options = {}) => {
105
105
  // to create a customized instance of a UI component
106
106
  name: "@haltcase/internal/TypeScript component files",
107
107
 
108
- files: ["**/components/**/*.ts"],
108
+ files: [
109
+ "**/components/**/*.ts",
110
+ ...(options.typescriptComponentPaths ?? [])
111
+ ],
109
112
  languageOptions,
110
113
 
111
114
  plugins: {
@@ -49,7 +49,7 @@ export const getTypescriptNamingConventionRule = ({
49
49
  regex: "^(ALL|GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)$"
50
50
  },
51
51
  format: null,
52
- selector: ["variableLike"]
52
+ selector: ["variableLike", "memberLike"]
53
53
  },
54
54
  // allow variable-likes called exactly "_"
55
55
  {
package/package.json CHANGED
@@ -1,173 +1,165 @@
1
1
  {
2
- "name": "@haltcase/style",
3
- "version": "8.0.0-canary.3",
4
- "description": "haltcase's web ecosystem style guide & configurations",
5
- "keywords": [
6
- "eslint",
7
- "prettier",
8
- "typescript",
9
- "style",
10
- "eslint-config"
11
- ],
12
- "homepage": "https://github.com/haltcase/style#readme",
13
- "bugs": "https://github.com/haltcase/style/issues",
14
- "repository": {
15
- "type": "git",
16
- "url": "https://github.com/haltcase/style.git"
17
- },
18
- "license": "MPL-2.0",
19
- "author": "Bo Lingen <bo@haltcase.dev> (https://haltcase.dev)",
20
- "type": "module",
21
- "exports": {
22
- "./eslint": {
23
- "types": "./dist/types/eslint/index.d.ts",
24
- "default": "./eslint/index.js"
25
- },
26
- "./eslint/rules/*": {
27
- "types": "./dist/types/eslint/rules/*.d.ts",
28
- "default": "./eslint/rules/*.js"
29
- },
30
- "./eslint/rules/typescript": {
31
- "types": "./dist/types/eslint/rules/typescript/index.d.ts",
32
- "default": "./eslint/rules/typescript/index.js"
33
- },
34
- "./prettier": {
35
- "types": "./dist/types/prettier/index.d.ts",
36
- "default": "./prettier/index.js"
37
- },
38
- "./stylelint": {
39
- "types": "./dist/types/stylelint/index.d.ts",
40
- "default": "./stylelint/index.js"
41
- },
42
- "./stylelint/modules": {
43
- "types": "./dist/types/stylelint/modules.d.ts",
44
- "default": "./stylelint/modules.js"
45
- },
46
- "./stylelint/standard": {
47
- "types": "./dist/types/stylelint/standard.d.ts",
48
- "default": "./stylelint/standard.js"
49
- },
50
- "./stylelint/tailwind": {
51
- "types": "./dist/types/stylelint/tailwind.d.ts",
52
- "default": "./stylelint/tailwind.js"
53
- },
54
- "./typescript/base": "./typescript/tsconfig.base.json",
55
- "./typescript/bundler": "./typescript/tsconfig.bundler.json",
56
- "./typescript/next": "./typescript/tsconfig.next.json",
57
- "./typescript/node": "./typescript/tsconfig.node.json",
58
- "./typescript/node18": "./typescript/tsconfig.node18.json",
59
- "./typescript/node20": "./typescript/tsconfig.node20.json",
60
- "./typescript/node22": "./typescript/tsconfig.node22.json",
61
- "./typescript/web": "./typescript/tsconfig.web.json"
62
- },
63
- "files": [
64
- "dist",
65
- "eslint",
66
- "prettier",
67
- "stylelint",
68
- "typescript",
69
- "next"
70
- ],
71
- "scripts": {
72
- "eslint-check": "eslint --max-warnings=0 .",
73
- "format": "eslint --fix . && prettier --write .",
74
- "prepare": "husky",
75
- "prepublishOnly": "tsc",
76
- "prettier-check": "prettier --check .",
77
- "semantic-release": "semantic-release",
78
- "test": "echo \"Error: no test specified\" && exit 1"
79
- },
80
- "lint-staged": {
81
- "*.{js,jsx,ts,tsx,css,yml,yaml}": "pnpm prettier --write"
82
- },
83
- "prettier": "./prettier/index.js",
84
- "stylelint": {
85
- "extends": "./stylelint/index.js"
86
- },
87
- "dependencies": {
88
- "@babel/core": "^7.26.9",
89
- "@babel/eslint-parser": "^7.26.8",
90
- "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
91
- "@eslint-react/eslint-plugin": "^1.26.2",
92
- "@next/eslint-plugin-next": "^15.1.7",
93
- "@stylistic/eslint-plugin-jsx": "^4.2.0",
94
- "eslint-config-prettier": "^10.0.1",
95
- "eslint-import-resolver-alias": "^1.1.2",
96
- "eslint-import-resolver-typescript": "^4.3.4",
97
- "eslint-plugin-import-x": "^4.6.1",
98
- "eslint-plugin-jsx-a11y": "^6.10.2",
99
- "eslint-plugin-playwright": "^2.2.0",
100
- "eslint-plugin-react": "^7.37.4",
101
- "eslint-plugin-react-hooks": "^5.1.0",
102
- "eslint-plugin-regexp": "^2.7.0",
103
- "eslint-plugin-simple-import-sort": "^12.1.1",
104
- "eslint-plugin-testing-library": "^7.1.1",
105
- "eslint-plugin-tsdoc": "^0.4.0",
106
- "eslint-plugin-unicorn": "^59.0.0",
107
- "postcss-html": "^1.8.0",
108
- "prettier-plugin-packagejson": "^2.5.8",
109
- "prettier-plugin-tailwindcss": "^0.6.11",
110
- "stylelint-config-clean-order": "^7.0.0",
111
- "stylelint-config-html": "^1.1.0",
112
- "stylelint-config-standard": "^37.0.0",
113
- "stylelint-config-tailwindcss": "^1.0.0",
114
- "stylelint-define-config": "^16.14.1",
115
- "typescript-eslint": "^8.24.0"
116
- },
117
- "devDependencies": {
118
- "@actions/core": "^1.11.1",
119
- "@actions/exec": "^1.1.1",
120
- "@actions/github": "^6.0.0",
121
- "@commitlint/cli": "^19.7.1",
122
- "@commitlint/config-conventional": "^19.7.1",
123
- "@eslint/eslintrc": "^3.2.0",
124
- "@eslint/js": "^9.20.0",
125
- "@octokit/types": "^13.8.0",
126
- "@semantic-release/git": "^10.0.1",
127
- "@types/eslint-config-prettier": "^6.11.3",
128
- "@types/node": "22",
129
- "@typescript-eslint/types": "^8.24.0",
130
- "eslint": "^9.20.1",
131
- "eslint-define-config": "^2.1.0",
132
- "globals": "^16.0.0",
133
- "husky": "^9.1.7",
134
- "lint-staged": "^15.4.3",
135
- "prettier": "^3.5.1",
136
- "semantic-release": "^24.2.3",
137
- "stylelint": "^16.14.1",
138
- "typescript": "^5.7.3"
139
- },
140
- "peerDependencies": {
141
- "eslint": ">=9",
142
- "prettier": ">=3.0.0 <4",
143
- "stylelint": ">=16.3.1 <17",
144
- "typescript": ">=5.0.0 <6"
145
- },
146
- "peerDependenciesMeta": {
147
- "eslint": {
148
- "optional": true
149
- },
150
- "prettier": {
151
- "optional": true
152
- },
153
- "stylelint": {
154
- "optional": true
155
- },
156
- "typescript": {
157
- "optional": true
158
- }
159
- },
160
- "packageManager": "pnpm@10.4.1",
161
- "engines": {
162
- "node": ">=20",
163
- "pnpm": ">=10"
164
- },
165
- "publishConfig": {
166
- "access": "public"
167
- },
168
- "pnpm": {
169
- "onlyBuiltDependencies": [
170
- "unrs-resolver"
171
- ]
172
- }
173
- }
2
+ "name": "@haltcase/style",
3
+ "version": "8.0.0-canary.6",
4
+ "description": "haltcase's web ecosystem style guide & configurations",
5
+ "keywords": [
6
+ "eslint",
7
+ "prettier",
8
+ "typescript",
9
+ "style",
10
+ "eslint-config"
11
+ ],
12
+ "homepage": "https://github.com/haltcase/style#readme",
13
+ "bugs": "https://github.com/haltcase/style/issues",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/haltcase/style.git"
17
+ },
18
+ "license": "MPL-2.0",
19
+ "author": "Bo Lingen <bo@haltcase.dev> (https://haltcase.dev)",
20
+ "type": "module",
21
+ "exports": {
22
+ "./eslint": {
23
+ "types": "./dist/types/eslint/index.d.ts",
24
+ "default": "./eslint/index.js"
25
+ },
26
+ "./eslint/rules/*": {
27
+ "types": "./dist/types/eslint/rules/*.d.ts",
28
+ "default": "./eslint/rules/*.js"
29
+ },
30
+ "./eslint/rules/typescript": {
31
+ "types": "./dist/types/eslint/rules/typescript/index.d.ts",
32
+ "default": "./eslint/rules/typescript/index.js"
33
+ },
34
+ "./prettier": {
35
+ "types": "./dist/types/prettier/index.d.ts",
36
+ "default": "./prettier/index.js"
37
+ },
38
+ "./stylelint": {
39
+ "types": "./dist/types/stylelint/index.d.ts",
40
+ "default": "./stylelint/index.js"
41
+ },
42
+ "./stylelint/modules": {
43
+ "types": "./dist/types/stylelint/modules.d.ts",
44
+ "default": "./stylelint/modules.js"
45
+ },
46
+ "./stylelint/standard": {
47
+ "types": "./dist/types/stylelint/standard.d.ts",
48
+ "default": "./stylelint/standard.js"
49
+ },
50
+ "./stylelint/tailwind": {
51
+ "types": "./dist/types/stylelint/tailwind.d.ts",
52
+ "default": "./stylelint/tailwind.js"
53
+ },
54
+ "./typescript/base": "./typescript/tsconfig.base.json",
55
+ "./typescript/bundler": "./typescript/tsconfig.bundler.json",
56
+ "./typescript/next": "./typescript/tsconfig.next.json",
57
+ "./typescript/node": "./typescript/tsconfig.node.json",
58
+ "./typescript/node18": "./typescript/tsconfig.node18.json",
59
+ "./typescript/node20": "./typescript/tsconfig.node20.json",
60
+ "./typescript/node22": "./typescript/tsconfig.node22.json",
61
+ "./typescript/web": "./typescript/tsconfig.web.json"
62
+ },
63
+ "files": [
64
+ "dist",
65
+ "eslint",
66
+ "prettier",
67
+ "stylelint",
68
+ "typescript",
69
+ "next"
70
+ ],
71
+ "lint-staged": {
72
+ "*.{js,jsx,ts,tsx,css,yml,yaml}": "pnpm prettier --write"
73
+ },
74
+ "prettier": "./prettier/index.js",
75
+ "stylelint": {
76
+ "extends": "./stylelint/index.js"
77
+ },
78
+ "dependencies": {
79
+ "@babel/core": "^7.26.9",
80
+ "@babel/eslint-parser": "^7.26.8",
81
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
82
+ "@eslint-react/eslint-plugin": "^1.26.2",
83
+ "@next/eslint-plugin-next": "^15.1.7",
84
+ "@stylistic/eslint-plugin-jsx": "^4.2.0",
85
+ "eslint-config-prettier": "^10.0.1",
86
+ "eslint-import-resolver-alias": "^1.1.2",
87
+ "eslint-import-resolver-typescript": "^4.3.4",
88
+ "eslint-plugin-import-x": "^4.6.1",
89
+ "eslint-plugin-jsx-a11y": "^6.10.2",
90
+ "eslint-plugin-playwright": "^2.2.0",
91
+ "eslint-plugin-react": "^7.37.4",
92
+ "eslint-plugin-react-hooks": "^5.1.0",
93
+ "eslint-plugin-regexp": "^2.7.0",
94
+ "eslint-plugin-simple-import-sort": "^12.1.1",
95
+ "eslint-plugin-testing-library": "^7.1.1",
96
+ "eslint-plugin-tsdoc": "^0.4.0",
97
+ "eslint-plugin-unicorn": "^60.0.0",
98
+ "postcss-html": "^1.8.0",
99
+ "prettier-plugin-packagejson": "^2.5.8",
100
+ "prettier-plugin-tailwindcss": "^0.6.11",
101
+ "stylelint-config-clean-order": "^7.0.0",
102
+ "stylelint-config-html": "^1.1.0",
103
+ "stylelint-config-standard": "^38.0.0",
104
+ "stylelint-config-tailwindcss": "^1.0.0",
105
+ "stylelint-define-config": "^16.14.1",
106
+ "typescript-eslint": "^8.40.0"
107
+ },
108
+ "devDependencies": {
109
+ "@actions/core": "^1.11.1",
110
+ "@actions/exec": "^1.1.1",
111
+ "@actions/github": "^6.0.0",
112
+ "@commitlint/cli": "^19.7.1",
113
+ "@commitlint/config-conventional": "^19.7.1",
114
+ "@eslint/eslintrc": "^3.2.0",
115
+ "@eslint/js": "^9.20.0",
116
+ "@octokit/types": "^14.0.0",
117
+ "@semantic-release/git": "^10.0.1",
118
+ "@types/eslint-config-prettier": "^6.11.3",
119
+ "@types/node": "22",
120
+ "@typescript-eslint/types": "^8.40.0",
121
+ "eslint": "^9.20.1",
122
+ "eslint-define-config": "^2.1.0",
123
+ "globals": "^16.0.0",
124
+ "husky": "^9.1.7",
125
+ "lint-staged": "^16.1.0",
126
+ "prettier": "^3.5.1",
127
+ "semantic-release": "^24.2.3",
128
+ "stylelint": "^16.14.1",
129
+ "typescript": "^5.7.3"
130
+ },
131
+ "peerDependencies": {
132
+ "eslint": ">=9",
133
+ "prettier": ">=3.0.0 <4",
134
+ "stylelint": ">=16.3.1 <17",
135
+ "typescript": ">=5.0.0 <6"
136
+ },
137
+ "peerDependenciesMeta": {
138
+ "eslint": {
139
+ "optional": true
140
+ },
141
+ "prettier": {
142
+ "optional": true
143
+ },
144
+ "stylelint": {
145
+ "optional": true
146
+ },
147
+ "typescript": {
148
+ "optional": true
149
+ }
150
+ },
151
+ "engines": {
152
+ "node": ">=20",
153
+ "pnpm": ">=10"
154
+ },
155
+ "publishConfig": {
156
+ "access": "public"
157
+ },
158
+ "scripts": {
159
+ "eslint-check": "eslint --max-warnings=0 .",
160
+ "format": "eslint --fix . && prettier --write .",
161
+ "prettier-check": "prettier --check .",
162
+ "semantic-release": "semantic-release",
163
+ "test": "echo \"Error: no test specified\" && exit 1"
164
+ }
165
+ }