@eslinted/defaults 17.2.0 → 17.2.2

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/.mocharc.yml CHANGED
@@ -1,11 +1,11 @@
1
1
  ####################
2
2
  ### .mocharc ###
3
- ### 1107.0.0 ###
3
+ ### 1107.1.0 ###
4
4
  ####################
5
5
 
6
6
  # https://mochajs.org/#configuration-format
7
7
  # https://mochajs.org/#command-line-usage
8
8
 
9
- spec: [dist/**/*.spec.js]
10
9
  extension: [js]
11
- # require: dist/_test/hooks.js
10
+ require: dist-tests/index.js
11
+ spec: [dist-tests/**/*.spec.js]
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "$pkg": "2411.0.0",
2
+ "$pkg": "2411.4.1",
3
3
  "$schema": "https://json.schemastore.org/package",
4
4
  "$help": "https://docs.npmjs.com/cli/configuring-npm/package-json",
5
5
  "name": "@eslinted/defaults",
6
- "version": "17.2.0",
6
+ "version": "17.2.2",
7
7
  "repository": "github:jimmy-zhening-luo/linted-defaults",
8
8
  "description": "Default scopes for `linted`",
9
9
  "keywords": [],
@@ -15,7 +15,8 @@
15
15
  "npm": "^11"
16
16
  },
17
17
  "type": "module",
18
- "peerDependenciesMeta": {},
18
+ "main": "dist/index.js",
19
+ "types": "dist/index.d.ts",
19
20
  "devDependencies": {
20
21
  "@types/chai": "^5.2.3",
21
22
  "@types/mocha": "^10.0.10",
@@ -24,26 +25,25 @@
24
25
  "ts-add-js-extension": "^1.6.6",
25
26
  "typescript": "^5.9.3"
26
27
  },
27
- "main": "dist/index.js",
28
- "types": "dist/index.d.ts",
29
28
  "scripts": {
30
- "clean": "cmd --% /c \"(if exist dist rmdir /s /q dist) & (if exist build rmdir /s /q build) & (if exist .eslintcache del /f /q .eslintcache)\" || rm -rf dist build .eslintcache",
31
- "prebuild": "npm run clean",
32
- "build": "cmd /c \"(if exist svelte.config.js (npm run build:svelte) else (npm run build:ts))\" || bash -c 'if [ -f svelte.config.js ]; then npm run build:svelte; else npm run build:ts; fi'",
33
- "build:ts": "tsc && ts-add-js-extension --dir=dist --showprogress=false",
29
+ "clean": "cmd --% /c \"for %G in (types dist dist-tests build packed) do (if exist %G rmdir /s /q %G) & for %G in (.eslintcache) do (if exist %G del /f /q %G)\" || rm -rf types dist dist-tests build packed .eslintcache",
30
+ "build": "npm run build:ts",
31
+ "build:ts": "tsc -b src",
34
32
  "build:svelte": "svelte-kit sync && svelte-check && vite build",
35
- "postbuild": "npm run lint || echo \"Lint failed. Continuing...\"",
33
+ "postbuild:ts": "npm run --if-present stage && ts-add-js-extension --showprogress=false --dir=dist",
34
+ "postbuild": "npm run lint || exit 0",
36
35
  "lint": "eslint --cache --fix",
37
36
  "pretest": "npm run build",
38
- "test": "npm run --if-present test:runner",
39
- "test:runner": "mocha",
40
- "prestart": "npm run --ignore-scripts build",
41
- "start": "cmd --% /c \"(if exist svelte.config.js (npm run start:svelte) else (npm run start:ts))\" || bash -c 'if [ -f svelte.config.js ]; then npm run start:svelte; else npm run start:ts; fi'",
37
+ "test": "npm run --if-present test:suite",
38
+ "test:suite": "tsc -b tests && ts-add-js-extension --showprogress=false --dir=dist-tests --include=dist && mocha",
39
+ "prestart": "npm run build",
40
+ "start": "npm run start:ts",
42
41
  "start:ts": "node .",
43
42
  "start:svelte": "vite preview --open",
44
- "prepublishOnly": "npm test",
43
+ "prepublishOnly": "npm run clean && npm test",
45
44
  "publish:release": "cmd --% /c \"for /f \"delims=-\" %a in (\"%npm_package_version%\") do if \"%a\" == \"%npm_package_version%\" (npm publish) else (npm publish --tag=next)\" || bash -c 'if [ \"${npm_package_version#*-}\" = \"${npm_package_version}\" ]; then npm publish; else npm publish --tag=next; fi'",
46
- "predeploy": "npm test",
45
+ "predeploy": "npm run clean && npm test",
46
+ "stage": "",
47
47
  "deploy": ""
48
48
  },
49
49
  "author": "Jimmy Zhening Luo <jimmy-zhening-luo@users.noreply.github.com> (https://jimm.my/)"
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "include": [
4
+ "../typings/**/*",
5
+ "**/*",
6
+ ],
7
+ "compilerOptions": {
8
+ "rootDir": ".",
9
+ "outDir": "../dist",
10
+ },
11
+ }
@@ -1,5 +1,5 @@
1
1
  import "chai/register-should.js";
2
- import defaults from ".";
2
+ import defaults from "../dist";
3
3
  import { scopes } from "./index.scopes.spec";
4
4
 
5
5
  describe(
package/tests/index.ts ADDED
@@ -0,0 +1,11 @@
1
+ export function mochaGlobalSetup() {
2
+ try {
3
+ //
4
+ }
5
+ catch (error) {
6
+ throw Error(
7
+ "Failed to hook up Mocha",
8
+ { cause: error },
9
+ );
10
+ }
11
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "include": [
4
+ "../src/**/*",
5
+ "../typings/**/*",
6
+ "**/*",
7
+ ],
8
+ "references": [
9
+ {
10
+ "path": "../src/tsconfig.json",
11
+ },
12
+ ],
13
+ "compilerOptions": {
14
+ "rootDir": ".",
15
+ "outDir": "../dist-tests",
16
+ },
17
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "display": "tsc@509.4.0",
3
+ "$help": "https://aka.ms/tsconfig/#quick-nav-Top%20Level",
4
+ "compilerOptions": {
5
+ "allowUnreachableCode": false,
6
+ "allowUnusedLabels": false,
7
+ "exactOptionalPropertyTypes": true,
8
+ "noFallthroughCasesInSwitch": true,
9
+ "noImplicitOverride": true,
10
+ "noImplicitReturns": true,
11
+ "noPropertyAccessFromIndexSignature": true,
12
+ "noUncheckedIndexedAccess": true,
13
+ "noUnusedLocals": true,
14
+ "noUnusedParameters": true,
15
+ "strict": true,
16
+ "allowArbitraryExtensions": true,
17
+ "module": "esnext",
18
+ "moduleResolution": "bundler",
19
+ "rewriteRelativeImportExtensions": true,
20
+ "declarationMap": true,
21
+ "noEmitOnError": true,
22
+ "removeComments": true,
23
+ "sourceMap": true,
24
+ "target": "esnext",
25
+ "composite": true,
26
+ },
27
+ }
package/tsconfig.json CHANGED
@@ -1,56 +1,34 @@
1
1
  {
2
- "display": "tsc@509.3.0",
3
- "include": [
4
- "src/**/*.ts",
5
- "typings/**/*.d.ts",
2
+ "files": [],
3
+ "extends": "./tsconfig-base.json",
4
+ "references": [
5
+ {
6
+ "path": "src/tsconfig.json",
7
+ },
8
+ {
9
+ "path": "tests/tsconfig.json",
10
+ },
11
+ {
12
+ "path": "typings/tsconfig.json",
13
+ },
6
14
  ],
7
15
  "compilerOptions": {
8
- "allowUnreachableCode": false,
9
- "allowUnusedLabels": false,
10
- "exactOptionalPropertyTypes": true,
11
- "noFallthroughCasesInSwitch": true,
12
- "noImplicitOverride": true,
13
- "noImplicitReturns": true,
14
- "noPropertyAccessFromIndexSignature": true,
15
- "noUncheckedIndexedAccess": true,
16
- "noUnusedLocals": true,
17
- "noUnusedParameters": true,
18
- "strict": true,
19
- "allowArbitraryExtensions": true,
20
- "module": "esnext",
21
- "moduleResolution": "bundler",
22
- // "paths": {},
23
- // "resolveJsonModule": true,
24
- // "resolvePackageJsonExports": true,
25
- // "resolvePackageJsonImports": true,
26
- "rewriteRelativeImportExtensions": true,
27
- // "rootDir": "src",
28
- // "rootDirs": [],
29
- // "typeRoots": [],
16
+ // "module": "esnext",
17
+ // "moduleResolution": "bundler",
30
18
  "types": [
31
19
  "mocha",
32
20
  "chai",
33
21
  /* {CONFIGURE} */
34
22
  ],
35
- "declaration": true,
36
- // "declarationDir": "",
37
- "declarationMap": true,
38
- // "emitDeclarationOnly": true,
39
- // "noEmit": true,
40
- "noEmitOnError": true,
41
- "outDir": "dist",
42
- "removeComments": true,
43
- "sourceMap": true,
44
- // "allowJs": true,
45
- // "checkJs": true,
46
- // "isolatedDeclarations": false,
23
+ // "declaration": true,
24
+ // "sourceMap": false,
47
25
  // "verbatimModuleSyntax": true,
48
26
  "lib": [
49
27
  "esnext",
50
28
  /* {CONFIGURE} */
51
29
  ],
52
- "target": "esnext",
53
- // "composite": true,
30
+ // "target": "esnext",
31
+ // "composite": false,
54
32
  // "skipLibCheck": true,
55
33
  },
56
34
  }
File without changes
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "include": [
4
+ "**/*",
5
+ ],
6
+ }
@@ -1,2 +0,0 @@
1
- export declare const scopes: readonly ["js", "ts", "mocha", "svelte", "html", "css", "json", "jsonc", "jsoncc", "yml"];
2
- //# sourceMappingURL=index.scopes.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.scopes.spec.d.ts","sourceRoot":"","sources":["../src/index.scopes.spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,2FAWT,CAAC"}
@@ -1,13 +0,0 @@
1
- export const scopes = [
2
- "js",
3
- "ts",
4
- "mocha",
5
- "svelte",
6
- "html",
7
- "css",
8
- "json",
9
- "jsonc",
10
- "jsoncc",
11
- "yml",
12
- ];
13
- //# sourceMappingURL=index.scopes.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.scopes.spec.js","sourceRoot":"","sources":["../src/index.scopes.spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;CACG,CAAC"}
@@ -1,2 +0,0 @@
1
- import "chai/register-should.js";
2
- //# sourceMappingURL=index.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC"}
@@ -1,126 +0,0 @@
1
- import "chai/register-should.js";
2
- import defaults from "./index.js";
3
- import { scopes } from "./index.scopes.spec.js";
4
- describe("Main Export", function () {
5
- const GLOBAL = "*", { ignores, files, rules, } = defaults;
6
- describe("module", function () {
7
- it("with object submodules: files, ignores, rules", function () {
8
- files
9
- .should
10
- .be
11
- .an("object");
12
- ignores
13
- .should
14
- .be
15
- .an("object");
16
- rules
17
- .should
18
- .be
19
- .an("object");
20
- });
21
- });
22
- describe("files", function () {
23
- it("only has all scopes", function () {
24
- files
25
- .should
26
- .have
27
- .keys(scopes);
28
- });
29
- it("of arrays", function () {
30
- for (const scope of Object.values(files))
31
- scope
32
- .should
33
- .be
34
- .an("array");
35
- });
36
- it("of expanded strings", function () {
37
- for (const scope of Object.values(files))
38
- for (const pattern of scope)
39
- pattern
40
- .should
41
- .be
42
- .a("string")
43
- .not
44
- .have
45
- .string("{")
46
- .not
47
- .have
48
- .string("}");
49
- });
50
- });
51
- describe("ignores", function () {
52
- it("only has globals and any scopes", function () {
53
- ignores
54
- .should
55
- .have
56
- .keys(GLOBAL, ...new Set(scopes).intersection(new Set(Object.keys(ignores))));
57
- });
58
- it("of arrays", function () {
59
- for (const scope of Object.values(ignores))
60
- scope
61
- .should
62
- .be
63
- .an("array");
64
- });
65
- it("of expanded strings", function () {
66
- for (const scope of Object.values(ignores))
67
- for (const pattern of scope)
68
- pattern
69
- .should
70
- .be
71
- .a("string")
72
- .not
73
- .have
74
- .string("{")
75
- .not
76
- .have
77
- .string("}");
78
- });
79
- });
80
- describe("rules", function () {
81
- it("only has all scopes", function () {
82
- rules
83
- .should
84
- .have
85
- .keys(scopes);
86
- });
87
- it("of arrays", function () {
88
- for (const scope of Object.values(rules))
89
- scope
90
- .should
91
- .be
92
- .an("array");
93
- });
94
- it("of rule config objects", function () {
95
- for (const scope of Object.values(rules))
96
- for (const config of scope) {
97
- config
98
- .should
99
- .be
100
- .an("object")
101
- .with
102
- .keys("rules")
103
- .with
104
- .own
105
- .property("rules")
106
- .an("object");
107
- for (const rule of Object.keys(config.rules)) {
108
- rule
109
- .should
110
- .be
111
- .a("string");
112
- const value = config.rules[rule];
113
- if (typeof value !== "number")
114
- value
115
- .should
116
- .be
117
- .an("array")
118
- .with
119
- .property("0")
120
- .a("number");
121
- }
122
- }
123
- });
124
- });
125
- });
126
- //# sourceMappingURL=index.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,QAAQ,MAAM,GAAG,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,QAAQ,CACN,aAAa,EACb;IACE,MAAM,MAAM,GAAG,GAAG,EAClB,EACE,OAAO,EACP,KAAK,EACL,KAAK,GACN,GAAG,QAAQ,CAAC;IAEb,QAAQ,CACN,QAAQ,EACR;QACE,EAAE,CACA,+CAA+C,EAC/C;YACE,KAAK;iBACF,MAAM;iBACN,EAAE;iBACF,EAAE,CAAC,QAAQ,CAAC,CAAC;YAChB,OAAO;iBACJ,MAAM;iBACN,EAAE;iBACF,EAAE,CAAC,QAAQ,CAAC,CAAC;YAChB,KAAK;iBACF,MAAM;iBACN,EAAE;iBACF,EAAE,CAAC,QAAQ,CAAC,CAAC;QAClB,CAAC,CACF,CAAC;IACJ,CAAC,CACF,CAAC;IACF,QAAQ,CACN,OAAO,EACP;QACE,EAAE,CACA,qBAAqB,EACrB;YACE,KAAK;iBACF,MAAM;iBACN,IAAI;iBACJ,IAAI,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CACF,CAAC;QACF,EAAE,CACA,WAAW,EACX;YACE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;gBACtC,KAAK;qBACF,MAAM;qBACN,EAAE;qBACF,EAAE,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC,CACF,CAAC;QACF,EAAE,CACA,qBAAqB,EACrB;YACE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;gBACtC,KAAK,MAAM,OAAO,IAAI,KAAK;oBACzB,OAAO;yBACJ,MAAM;yBACN,EAAE;yBACF,CAAC,CAAC,QAAQ,CAAC;yBACX,GAAG;yBACH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