tangled
alpha
login
or
join now
tylur.dev
/
prototypey
prototypey.org - atproto lexicon typescript toolkit - mirror https://github.com/tylersayshi/prototypey
1
fork
atom
overview
issues
pulls
pipelines
linting back on with some rules off
Tyler
3 months ago
5494cf73
8ecbee41
+56
-20
13 changed files
expand all
collapse all
unified
split
eslint.config.js
package.json
packages
cli
package.json
src
commands
gen-emit.ts
tests
commands
gen-emit.test.ts
integration
error-handling.test.ts
filesystem.test.ts
workflow.test.ts
prototypey
package.json
site
eslint.config.js
package.json
src
components
Editor.tsx
Playground.tsx
+6
-11
eslint.config.js
···
1
1
import eslint from "@eslint/js";
2
2
import tseslint from "typescript-eslint";
3
3
-
import reactCompiler from "eslint-plugin-react-compiler";
4
3
5
4
export default tseslint.config(
6
6
-
{ ignores: ["lib", "node_modules", "pnpm-lock.yaml", "setup-vitest.ts"] },
5
5
+
{ ignores: ["**/lib/**", "**/dist/**", "node_modules", "pnpm-lock.yaml", "**/setup-vitest.ts", "**/cli.js", "**/tests/**"] },
7
6
{ linterOptions: { reportUnusedDisableDirectives: "error" } },
8
7
eslint.configs.recommended,
9
8
{
···
19
18
},
20
19
rules: {
21
20
"@typescript-eslint/consistent-type-definitions": "off",
22
22
-
},
23
23
-
},
24
24
-
{
25
25
-
files: ["**/*.{jsx,tsx}"],
26
26
-
plugins: {
27
27
-
"react-compiler": reactCompiler,
28
28
-
},
29
29
-
rules: {
30
30
-
"react-compiler/react-compiler": "error",
21
21
+
"@typescript-eslint/no-unsafe-assignment": "off",
22
22
+
"@typescript-eslint/no-unsafe-argument": "off",
23
23
+
"@typescript-eslint/no-unsafe-member-access": "off",
24
24
+
"@typescript-eslint/no-unsafe-call": "off",
25
25
+
"@typescript-eslint/restrict-plus-operands": "off",
31
26
},
32
27
},
33
28
{
+1
package.json
···
2
2
"name": "prototypey-monorepo",
3
3
"version": "0.0.0",
4
4
"private": true,
5
5
+
"type": "module",
5
6
"description": "atproto lexicon typescript toolkit",
6
7
"repository": {
7
8
"type": "git",
+1
packages/cli/package.json
···
22
22
],
23
23
"scripts": {
24
24
"build": "tsdown --entry src/index.ts --format esm --dts false",
25
25
+
"lint": "eslint .",
25
26
"test": "vitest run",
26
27
"tsc": "tsc"
27
28
},
+1
-1
packages/cli/src/commands/gen-emit.ts
···
29
29
return;
30
30
}
31
31
32
32
-
console.log(`Found ${sourceFiles.length} source file(s)`);
32
32
+
console.log(`Found ${String(sourceFiles.length)} source file(s)`);
33
33
34
34
// Ensure output directory exists
35
35
await mkdir(outdir, { recursive: true });
+1
-1
packages/cli/tests/commands/gen-emit.test.ts
···
10
10
11
11
beforeEach(async () => {
12
12
// Create a temporary directory for test files
13
13
-
testDir = join(tmpdir(), `prototypey-test-${Date.now()}`);
13
13
+
testDir = join(tmpdir(), `prototypey-test-${String(Date.now())}`);
14
14
outDir = join(testDir, "output");
15
15
await mkdir(testDir, { recursive: true });
16
16
await mkdir(outDir, { recursive: true });
+1
-1
packages/cli/tests/integration/error-handling.test.ts
···
11
11
12
12
beforeEach(async () => {
13
13
// Create a temporary directory for test files
14
14
-
testDir = join(tmpdir(), `prototypey-error-test-${Date.now()}`);
14
14
+
testDir = join(tmpdir(), `prototypey-error-test-${String(Date.now())}`);
15
15
outDir = join(testDir, "output");
16
16
schemasDir = join(testDir, "schemas");
17
17
await mkdir(testDir, { recursive: true });
+1
-1
packages/cli/tests/integration/filesystem.test.ts
···
18
18
19
19
beforeEach(async () => {
20
20
// Create a temporary directory for test files
21
21
-
testDir = join(tmpdir(), `prototypey-fs-test-${Date.now()}`);
21
21
+
testDir = join(tmpdir(), `prototypey-fs-test-${String(Date.now())}`);
22
22
outDir = join(testDir, "output");
23
23
schemasDir = join(testDir, "schemas");
24
24
await mkdir(testDir, { recursive: true });
+1
-1
packages/cli/tests/integration/workflow.test.ts
···
11
11
12
12
beforeEach(async () => {
13
13
// Create a temporary directory for test files
14
14
-
testDir = join(tmpdir(), `prototypey-e2e-test-${Date.now()}`);
14
14
+
testDir = join(tmpdir(), `prototypey-e2e-test-${String(Date.now())}`);
15
15
schemasDir = join(testDir, "schemas");
16
16
generatedDir = join(testDir, "generated");
17
17
await mkdir(testDir, { recursive: true });
+1
packages/prototypey/package.json
···
28
28
],
29
29
"scripts": {
30
30
"build": "tsdown",
31
31
+
"lint": "eslint .",
31
32
"test": "vitest run",
32
33
"test:bench": "node tests/infer.bench.ts",
33
34
"test:update-snapshots": "vitest run -u",
+37
packages/site/eslint.config.js
···
1
1
+
import baseConfig from "../../eslint.config.js";
2
2
+
import reactCompiler from "eslint-plugin-react-compiler";
3
3
+
import tseslint from "typescript-eslint";
4
4
+
5
5
+
export default tseslint.config(
6
6
+
...baseConfig,
7
7
+
{
8
8
+
files: ["**/*.{jsx,tsx}"],
9
9
+
extends: [
10
10
+
tseslint.configs.strictTypeChecked,
11
11
+
tseslint.configs.stylisticTypeChecked,
12
12
+
],
13
13
+
languageOptions: {
14
14
+
parserOptions: {
15
15
+
projectService: { allowDefaultProject: ["*.config.*s"] },
16
16
+
},
17
17
+
},
18
18
+
plugins: {
19
19
+
"react-compiler": reactCompiler,
20
20
+
},
21
21
+
rules: {
22
22
+
"@typescript-eslint/consistent-type-definitions": "off",
23
23
+
"@typescript-eslint/no-unsafe-assignment": "off",
24
24
+
"@typescript-eslint/no-unsafe-argument": "off",
25
25
+
"@typescript-eslint/no-unsafe-member-access": "off",
26
26
+
"@typescript-eslint/no-unsafe-call": "off",
27
27
+
"@typescript-eslint/restrict-plus-operands": "off",
28
28
+
"@typescript-eslint/no-confusing-void-expression": "off",
29
29
+
"@typescript-eslint/prefer-nullish-coalescing": "off",
30
30
+
"@typescript-eslint/prefer-regexp-exec": "off",
31
31
+
"@typescript-eslint/no-implied-eval": "off",
32
32
+
"@typescript-eslint/no-non-null-assertion": "off",
33
33
+
"@typescript-eslint/no-floating-promises": "off",
34
34
+
"react-compiler/react-compiler": "error",
35
35
+
},
36
36
+
},
37
37
+
);
+1
packages/site/package.json
···
6
6
"scripts": {
7
7
"dev": "vite",
8
8
"build": "tsc && vite build",
9
9
+
"lint": "eslint .",
9
10
"preview": "vite preview",
10
11
"test": "vitest"
11
12
},
+1
-1
packages/site/src/components/Editor.tsx
···
44
44
noSyntaxValidation: false,
45
45
});
46
46
47
47
-
Promise.all([
47
47
+
void Promise.all([
48
48
import("prototypey/lib/type-utils.d.ts?raw"),
49
49
import("prototypey/lib/infer.d.ts?raw"),
50
50
import("prototypey/lib/lib.d.ts?raw"),
+3
-3
packages/site/src/components/Playground.tsx
···
59
59
console.error("Failed to initialize TypeScript worker:", err);
60
60
}
61
61
};
62
62
-
initWorker();
62
62
+
void initWorker();
63
63
}
64
64
}, [monaco, editorReady]);
65
65
···
278
278
}}
279
279
>
280
280
<MonacoEditor
281
281
-
height={`${codeWrappedLines * 18 + 32}px`}
281
281
+
height={`${String(codeWrappedLines * 18 + 32)}px`}
282
282
defaultLanguage="typescript"
283
283
value={code}
284
284
theme={theme}
···
330
330
}}
331
331
>
332
332
<MonacoEditor
333
333
-
height={`${jsonWrappedLines * 18 + 32}px`}
333
333
+
height={`${String(jsonWrappedLines * 18 + 32)}px`}
334
334
defaultLanguage="json"
335
335
value={json}
336
336
theme={theme}