linted 13.0.2 → 13.0.4

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
@@ -1,4 +1,4 @@
1
- # [linted](https://npmjs.com/package/linted)
1
+ # [linted](https://npmjs.com/package/linted) v13
2
2
 
3
3
  Zero-config [**ESLint**](https://eslint.org/) flat config factory for (strict, agglutinative) entire-stack formatting and linting: TypeScript, JavaScript, Svelte, HTML, (Tailwind) CSS, Jest, JSON(C), and sadly YAML.
4
4
 
@@ -36,38 +36,40 @@ Zero-config [**ESLint**](https://eslint.org/) flat config factory for (strict, a
36
36
  ```javascript
37
37
  import linted from "linted";
38
38
 
39
- export default [
40
- ...new linted(
41
- { // Scope (i.e. files to lint)
42
- js: ["*.config.js"],
43
- ts: ["*.config.ts", "src/**/*.ts"],
44
- svelte: ["src/**/*.svelte"],
45
- },
46
- )
47
- .configs,
48
- ];
39
+ export default new linted(
40
+ { // Scope (i.e. files to lint)
41
+ js: [
42
+ "eslint.config.js",
43
+ "svelte.config.js",
44
+ ],
45
+ ts: [
46
+ "src/**/*.ts",
47
+ "vite.config.ts",
48
+ ],
49
+ svelte: ["src/**/*.svelte"],
50
+ // ...
51
+ },
52
+ );
49
53
  ```
50
54
 
51
55
  ### Full Control via *Per-Scope* Override
52
56
 
53
57
  ```javascript
54
- // ...Scope (i.e. files to lint)
58
+ // ...Scope (i.e. files to lint)
59
+ },
60
+ { // Optional: Override
61
+ overrideTs: {
62
+ // Turns it off in "ts" scope,
63
+ // but NOT in "js" scope,
64
+ // NOR in "svelte" scope.
65
+ "no-unused-vars": "off", // JS base rule
66
+ // "@typescript-eslint/ ..., or TS plugin rule
55
67
  },
56
- { // Optional: Override
57
- overrideTs: {
58
- // Turns it off in "ts" scope,
59
- // but NOT in "js" scope,
60
- // NOR in "svelte" scope.
61
- "no-unused-vars": "off", // JS base rule
62
- // "@typescript-eslint/ ..., or TS plugin rule
63
- },
64
- overrideSvelte: {
65
- // ... JS, TS, or Svelte plugin rules
66
- },
68
+ overrideSvelte: {
69
+ // ... JS, TS, or Svelte plugin rules
67
70
  },
68
- )
69
- .configs,
70
- ];
71
+ },
72
+ );
71
73
  ```
72
74
 
73
75
  ### Zero-Dependency
@@ -127,22 +129,24 @@ If linting `TypeScript` files, [`skipLibCheck`](https://www.typescriptlang.org/t
127
129
  1. Install [`eslint`](https://npmjs.com/package/eslint) and [`linted`](https://npmjs.com/package/linted)
128
130
 
129
131
  ```bash
130
- npm i -D eslint@^8.57 linted@^12.1
132
+ npm i -D eslint@^8.57 linted@^13
131
133
  ```
132
134
 
133
135
  1. Create `eslint.config.js` in your root directory.
134
136
 
135
137
  1. In `eslint.config.js`:
136
- - Import `linted`.
138
+ - Import `function` `linted`.
137
139
 
138
140
  ```javascript
139
141
  import linted from "linted";
140
142
  ```
141
143
 
142
- - Create a new instance of `linted`, with arguments:
144
+ - Export `linted` with arguments:
143
145
 
144
146
  ```javascript
145
- new linted(
147
+ import linted from "linted";
148
+
149
+ export default linted(
146
150
  { // Scope (i.e. files to lint)
147
151
  js: ["*.config.js"], // glob pattern array
148
152
  ts: ["*.config.ts", "src/**/*.ts"],
@@ -161,21 +165,7 @@ If linting `TypeScript` files, [`skipLibCheck`](https://www.typescriptlang.org/t
161
165
  // overrideHtml, overrideCss, overrideJsonc,
162
166
  // overrideJson, overrideYml
163
167
  },
164
- )
165
- ```
166
-
167
- - Export member `configs` from the new instance of `linted`, which is ESLint's flat config. *e.g.*
168
-
169
- ```javascript
170
- import linted from "linted";
171
-
172
- export default [
173
- ...new linted(
174
- // ...
175
- )
176
- .configs,
177
- ];
178
-
168
+ );
179
169
  ```
180
170
 
181
171
  ___
@@ -248,10 +238,10 @@ yml
248
238
 
249
239
  - svelte: .js, .ts, .svelte
250
240
 
251
- - jest: .js, .ts, (.spec).ts
252
-
253
241
  - html: .html
254
242
 
243
+ - jest: .js, .ts, (.spec).ts
244
+
255
245
  - jsonc: .json (JSON), .json (JSONC)
256
246
 
257
247
  - json: .json (JSON)
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HtmlOption.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlOption.spec.d.ts","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/HtmlOption.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import HtmlOption from "./HtmlOption.js";
2
+ const FakePlugin = { cool: "beans" };
3
+ const FakeParser = { parse: "me" };
4
+ describe("HtmlOption", () => {
5
+ it("is instantiable", () => {
6
+ expect(new HtmlOption({ "@html-eslint": FakePlugin }, FakeParser, "src/**/*.html").body.files[0])
7
+ .toBe("src/**/*.html");
8
+ });
9
+ });
10
+ //# sourceMappingURL=HtmlOption.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlOption.spec.js","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/HtmlOption.spec.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAEnC,QAAQ,CACN,YAAY,EACZ,GAAG,EAAE;IACH,EAAE,CACA,iBAAiB,EACjB,GAAG,EAAE;QACH,MAAM,CACJ,IAAI,UAAU,CACZ,EAAE,cAAc,EAAE,UAAU,EAAE,EAC9B,UAAU,EACV,eAAe,CAChB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAChB;aACE,IAAI,CACH,eAAe,CAChB,CAAC;IACN,CAAC,CACF,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,2 +1 @@
1
- export {};
2
1
  //# sourceMappingURL=JestEnable.d.ts.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ "use strict";
2
2
  //# sourceMappingURL=JestEnable.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linted",
3
- "version": "13.0.2",
3
+ "version": "13.0.4",
4
4
  "description": "Zero-config ESLint flat config factory for (strict, agglutinative) entire-stack formatting and linting: TypeScript, JavaScript, Svelte, HTML, (Tailwind) CSS, Jest, JSON(C), and sadly YAML.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -25,7 +25,7 @@
25
25
  "type": "module",
26
26
  "private": false,
27
27
  "config": {
28
- "PACKAGE_JSON_VERSION": "20.0.0"
28
+ "PACKAGE_JSON_VERSION": "20.1.0"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
@@ -58,7 +58,6 @@
58
58
  "optional": true
59
59
  }
60
60
  },
61
- "optionalDependencies": {},
62
61
  "dependencies": {
63
62
  "@html-eslint/eslint-plugin": "~0.25.0",
64
63
  "@html-eslint/parser": "~0.25.0",
@@ -66,6 +65,7 @@
66
65
  "@types/jest": "^29.5.12",
67
66
  "@typescript-eslint/eslint-plugin": "~7.14.1",
68
67
  "@typescript-eslint/parser": "~7.14.1",
68
+ "cross-env": "^7.0.3",
69
69
  "eslint-plugin-jest": "~28.6.0",
70
70
  "eslint-plugin-jsonc": "~2.16.0",
71
71
  "eslint-plugin-svelte": "~2.41.0",
@@ -77,9 +77,16 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "eslint": "~8.57.0",
80
- "linted": "~13.0.1",
80
+ "jest": "^29.7.0",
81
+ "linted": "~13.0.3",
81
82
  "typescript": "^5.5.2"
82
83
  },
84
+ "jest": {
85
+ "testPathIgnorePatterns": [
86
+ "/node_modules/",
87
+ "/src/"
88
+ ]
89
+ },
83
90
  "scripts": {
84
91
  "e": "eslint -c eslint.config.js --cache --fix",
85
92
  "lint": "(npm run lint:cfg) && (npm run lint:src) && (npm run --if-present lint:ci) && (npm run --if-present lint:svelte)",
@@ -88,7 +95,8 @@
88
95
  "prebuild": "npm run lint",
89
96
  "build": "tsc",
90
97
  "pretest": "npm run build",
91
- "test": "exit 0",
92
- "prepublishOnly": "npm run test"
98
+ "test": "(npm run test:jest) || (exit 0)",
99
+ "test:jest": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" NODE_NO_WARNINGS=1 jest --",
100
+ "prepublishOnly": "npm test"
93
101
  }
94
102
  }