Skip to content

Commit 6b8de88

Browse files
committed
move examples/* to spec/
1 parent 5e26a8c commit 6b8de88

File tree

5 files changed

+160
-1
lines changed

5 files changed

+160
-1
lines changed
File renamed without changes.

spec/eslint.mts.stdout

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"default": {
3+
"root": true,
4+
"extends": [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:import/recommended",
8+
"plugin:import/typescript",
9+
"prettier"
10+
],
11+
"plugins": [
12+
"@typescript-eslint/eslint-plugin",
13+
"eslint-plugin-tsdoc"
14+
],
15+
"parser": "@typescript-eslint/parser",
16+
"parserOptions": {
17+
"project": "./tsconfig.json"
18+
},
19+
"settings": {},
20+
"rules": {
21+
"no-constant-condition": [
22+
"warn",
23+
{
24+
"checkLoops": false
25+
}
26+
],
27+
"no-useless-escape": "warn",
28+
"no-console": "warn",
29+
"no-var": "warn",
30+
"no-return-await": "warn",
31+
"prefer-const": "warn",
32+
"guard-for-in": "warn",
33+
"curly": "warn",
34+
"no-param-reassign": "warn",
35+
"prefer-spread": "warn",
36+
"import/no-unresolved": "off",
37+
"import/no-cycle": "error",
38+
"import/no-default-export": "warn",
39+
"tsdoc/syntax": "warn",
40+
"@typescript-eslint/await-thenable": "warn",
41+
"@typescript-eslint/array-type": [
42+
"warn",
43+
{
44+
"default": "generic"
45+
}
46+
],
47+
"@typescript-eslint/naming-convention": [
48+
"warn",
49+
{
50+
"selector": "default",
51+
"format": [
52+
"camelCase",
53+
"UPPER_CASE",
54+
"PascalCase"
55+
],
56+
"leadingUnderscore": "allow"
57+
},
58+
{
59+
"selector": "typeLike",
60+
"format": [
61+
"PascalCase"
62+
],
63+
"leadingUnderscore": "allow"
64+
}
65+
],
66+
"@typescript-eslint/restrict-plus-operands": "warn",
67+
"@typescript-eslint/no-throw-literal": "warn",
68+
"@typescript-eslint/unbound-method": "warn",
69+
"@typescript-eslint/explicit-module-boundary-types": "warn",
70+
"@typescript-eslint/no-extra-semi": "warn",
71+
"@typescript-eslint/no-extra-non-null-assertion": "warn",
72+
"@typescript-eslint/no-unused-vars": [
73+
"warn",
74+
{
75+
"argsIgnorePattern": "^_"
76+
}
77+
],
78+
"@typescript-eslint/no-use-before-define": "warn",
79+
"@typescript-eslint/no-for-in-array": "warn",
80+
"@typescript-eslint/no-unsafe-argument": "warn",
81+
"@typescript-eslint/no-unsafe-call": "warn",
82+
"@typescript-eslint/no-unnecessary-condition": [
83+
"warn",
84+
{
85+
"allowConstantLoopConditions": true
86+
}
87+
],
88+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
89+
"@typescript-eslint/no-implied-eval": "warn",
90+
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
91+
"@typescript-eslint/no-invalid-void-type": "warn",
92+
"@typescript-eslint/no-loss-of-precision": "warn",
93+
"@typescript-eslint/no-confusing-void-expression": "warn",
94+
"@typescript-eslint/no-redundant-type-constituents": "warn",
95+
"@typescript-eslint/prefer-for-of": "warn",
96+
"@typescript-eslint/prefer-includes": "warn",
97+
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
98+
"@typescript-eslint/prefer-readonly": "warn",
99+
"@typescript-eslint/prefer-regexp-exec": "warn",
100+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
101+
"@typescript-eslint/prefer-optional-chain": "warn",
102+
"@typescript-eslint/prefer-ts-expect-error": "warn",
103+
"@typescript-eslint/indent": "off",
104+
"@typescript-eslint/no-explicit-any": "off",
105+
"@typescript-eslint/no-empty-interface": "off",
106+
"@typescript-eslint/no-empty-function": "off",
107+
"@typescript-eslint/no-var-requires": "off",
108+
"@typescript-eslint/no-non-null-assertion": "off",
109+
"@typescript-eslint/ban-ts-comment": "off"
110+
}
111+
}
112+
}

spec/jest.config.mts.stdout

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"default": {
3+
"collectCoverage": true,
4+
"collectCoverageFrom": [
5+
"src/**/*.{js,jsx,ts,tsx}"
6+
],
7+
"coverageReporters": [
8+
"lcov"
9+
],
10+
"moduleFileExtensions": [
11+
"ts",
12+
"tsx",
13+
"mts",
14+
"mtsx",
15+
"cjs",
16+
"js",
17+
"jsx",
18+
"mjs",
19+
"mjsx",
20+
"json",
21+
"node"
22+
],
23+
"setupFilesAfterEnv": [
24+
"console-fail-test/setup.js"
25+
],
26+
"testRegex": [
27+
"./tests/.+\\.test\\.ts$",
28+
"./tests/.+\\.spec\\.ts$"
29+
],
30+
"transform": {
31+
"^.+\\.(t|j)sx?$": [
32+
"@swc/jest",
33+
{
34+
"jsc": {
35+
"target": "es2019",
36+
"transform": {
37+
"react": {
38+
"runtime": "automatic"
39+
}
40+
}
41+
}
42+
}
43+
]
44+
},
45+
"workerIdleMemoryLimit": "300MB"
46+
}
47+
}

tests/spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn collect_specs(spec_dir: &Path) -> Vec<Spec> {
3636

3737
if path.is_file() {
3838
let filename = path.file_name().unwrap().to_str().unwrap();
39-
if filename.ends_with(".ts") {
39+
if filename.ends_with(".ts") || filename.ends_with(".mts") {
4040
let mut expected_stdout = String::new(); // $filename.stdout
4141
let mut expected_stderr = String::new(); // $filename.stderr
4242

0 commit comments

Comments
 (0)