tangled
alpha
login
or
join now
frontpage.fyi
/
frontpage
21
fork
atom
AT-based link agregator. Mirror of https://github.com/likeandscribe/frontpage
21
fork
atom
overview
issues
pulls
pipelines
Refactor react and typescript lint configs out
tom.sherman.is
11 months ago
8b7b2219
ecc8b924
verified
This commit was signed with the committer's
known signature
.
tom.sherman.is
SSH Key Fingerprint:
SHA256:s683B2DU0yXjYHmKfzMF5t1GryE92wn75ZgRoLJ76HY=
+90
-84
7 changed files
expand all
collapse all
unified
split
packages
atproto-browser
eslint.config.mjs
eslint-config
next.js
react.js
tsconfig.json
typescript.js
frontpage
eslint.config.mjs
unravel
eslint.config.mjs
+4
-4
packages/atproto-browser/eslint.config.mjs
···
1
1
-
import { defineConfig } from "@repo/eslint-config/next.js";
2
2
-
3
3
-
export default defineConfig(import.meta.dirname, [
1
1
+
import base from "@repo/eslint-config/next.js";
2
2
+
export default [
3
3
+
...base,
4
4
{
5
5
rules: {
6
6
"no-restricted-imports": ["error", "next/link"],
7
7
},
8
8
},
9
9
-
]);
9
9
+
];
+12
-74
packages/eslint-config/next.js
···
1
1
-
import eslint from "@eslint/js";
2
1
import tseslint from "typescript-eslint";
3
3
-
import reactCompiler from "eslint-plugin-react-compiler";
2
2
+
import typescript from "./typescript.js";
3
3
+
import react from "./react.js";
4
4
// @ts-ignore no types
5
5
import next from "@next/eslint-plugin-next";
6
6
-
import jsxA11y from "eslint-plugin-jsx-a11y";
7
7
-
import reactHooks from "eslint-plugin-react-hooks";
8
8
-
import react from "eslint-plugin-react";
9
9
-
import { version as reactVersion } from "react";
10
6
import turboRepo from "eslint-config-turbo/flat";
11
7
12
12
-
/**
13
13
-
* @param {string} baseDirectory
14
14
-
* @param {import("typescript-eslint").InfiniteDepthConfigWithExtends[]} configs
15
15
-
*/
16
16
-
export function defineConfig(baseDirectory, configs = []) {
17
17
-
return tseslint.config(
18
18
-
{
19
19
-
ignores: ["**/.next/**", "**/.vercel/**"],
20
20
-
},
21
21
-
next.flatConfig.recommended,
22
22
-
next.flatConfig.coreWebVitals,
8
8
+
export default tseslint.config(
9
9
+
typescript,
10
10
+
react,
11
11
+
{
12
12
+
ignores: ["**/.next/**", "**/.vercel/**"],
13
13
+
},
23
14
24
24
-
...turboRepo,
25
25
-
26
26
-
eslint.configs.recommended,
27
27
-
tseslint.configs.recommendedTypeChecked,
28
28
-
reactCompiler.configs.recommended,
29
29
-
reactHooks.configs["recommended-latest"],
30
30
-
// @ts-expect-error
31
31
-
react.configs.flat.recommended,
32
32
-
jsxA11y.flatConfigs.recommended,
33
33
-
{
34
34
-
languageOptions: {
35
35
-
parserOptions: {
36
36
-
projectService: true,
37
37
-
tsconfigRootDir: baseDirectory,
38
38
-
},
39
39
-
},
40
40
-
41
41
-
settings: {
42
42
-
react: {
43
43
-
version: reactVersion,
44
44
-
},
45
45
-
},
15
15
+
next.flatConfig.recommended,
16
16
+
next.flatConfig.coreWebVitals,
46
17
47
47
-
rules: {
48
48
-
"react/react-in-jsx-scope": "off",
49
49
-
"react/prop-types": "off",
50
50
-
"react/no-array-index-key": "error",
51
51
-
"@typescript-eslint/no-unsafe-assignment": "off",
52
52
-
"@typescript-eslint/no-floating-promises": "error",
53
53
-
"@typescript-eslint/no-misused-promises": "error",
54
54
-
"@typescript-eslint/consistent-type-imports": [
55
55
-
"error",
56
56
-
{
57
57
-
fixStyle: "inline-type-imports",
58
58
-
prefer: "type-imports",
59
59
-
},
60
60
-
],
61
61
-
"@typescript-eslint/consistent-type-exports": [
62
62
-
"error",
63
63
-
{ fixMixedExportsWithInlineTypeSpecifier: true },
64
64
-
],
65
65
-
"@typescript-eslint/no-unused-vars": [
66
66
-
"error",
67
67
-
{
68
68
-
args: "all",
69
69
-
argsIgnorePattern: "^_",
70
70
-
caughtErrors: "all",
71
71
-
caughtErrorsIgnorePattern: "^_",
72
72
-
destructuredArrayIgnorePattern: "^_",
73
73
-
varsIgnorePattern: "^_",
74
74
-
ignoreRestSiblings: true,
75
75
-
},
76
76
-
],
77
77
-
},
78
78
-
},
79
79
-
...configs,
80
80
-
);
81
81
-
}
18
18
+
turboRepo,
19
19
+
);
82
20
83
21
// Bring @typescript-eslint/utils types into scope to solve a non-portable typescript issue caused by pnpm
84
22
/**
+27
packages/eslint-config/react.js
···
1
1
+
import tseslint from "typescript-eslint";
2
2
+
import jsxA11y from "eslint-plugin-jsx-a11y";
3
3
+
import reactHooks from "eslint-plugin-react-hooks";
4
4
+
import react from "eslint-plugin-react";
5
5
+
import { version as reactVersion } from "react";
6
6
+
import reactCompiler from "eslint-plugin-react-compiler";
7
7
+
8
8
+
export default tseslint.config(
9
9
+
reactCompiler.configs.recommended,
10
10
+
reactHooks.configs["recommended-latest"],
11
11
+
// @ts-expect-error
12
12
+
react.configs.flat.recommended,
13
13
+
jsxA11y.flatConfigs.recommended,
14
14
+
{
15
15
+
settings: {
16
16
+
react: {
17
17
+
version: reactVersion,
18
18
+
},
19
19
+
},
20
20
+
21
21
+
rules: {
22
22
+
"react/react-in-jsx-scope": "off",
23
23
+
"react/prop-types": "off",
24
24
+
"react/no-array-index-key": "error",
25
25
+
},
26
26
+
},
27
27
+
);
+1
-1
packages/eslint-config/tsconfig.json
···
1
1
{
2
2
"extends": "@repo/typescript-config/base.json",
3
3
-
"include": ["next.js"],
3
3
+
"include": ["next.js", "typescript.js", "react.js"],
4
4
"compilerOptions": {
5
5
"checkJs": true,
6
6
"module": "NodeNext",
+42
packages/eslint-config/typescript.js
···
1
1
+
import eslint from "@eslint/js";
2
2
+
import tseslint from "typescript-eslint";
3
3
+
4
4
+
export default tseslint.config(
5
5
+
eslint.configs.recommended,
6
6
+
tseslint.configs.recommendedTypeChecked,
7
7
+
{
8
8
+
languageOptions: {
9
9
+
parserOptions: {
10
10
+
projectService: true,
11
11
+
},
12
12
+
},
13
13
+
rules: {
14
14
+
"@typescript-eslint/no-unsafe-assignment": "off",
15
15
+
"@typescript-eslint/no-floating-promises": "error",
16
16
+
"@typescript-eslint/no-misused-promises": "error",
17
17
+
"@typescript-eslint/consistent-type-imports": [
18
18
+
"error",
19
19
+
{
20
20
+
fixStyle: "inline-type-imports",
21
21
+
prefer: "type-imports",
22
22
+
},
23
23
+
],
24
24
+
"@typescript-eslint/consistent-type-exports": [
25
25
+
"error",
26
26
+
{ fixMixedExportsWithInlineTypeSpecifier: true },
27
27
+
],
28
28
+
"@typescript-eslint/no-unused-vars": [
29
29
+
"error",
30
30
+
{
31
31
+
args: "all",
32
32
+
argsIgnorePattern: "^_",
33
33
+
caughtErrors: "all",
34
34
+
caughtErrorsIgnorePattern: "^_",
35
35
+
destructuredArrayIgnorePattern: "^_",
36
36
+
varsIgnorePattern: "^_",
37
37
+
ignoreRestSiblings: true,
38
38
+
},
39
39
+
],
40
40
+
},
41
41
+
},
42
42
+
);
+2
-3
packages/frontpage/eslint.config.mjs
···
1
1
-
import { defineConfig } from "@repo/eslint-config/next.js";
2
2
-
3
3
-
export default defineConfig(import.meta.dirname);
1
1
+
import base from "@repo/eslint-config/next.js";
2
2
+
export default base;
+2
-2
packages/unravel/eslint.config.mjs
···
1
1
-
import { defineConfig } from "@repo/eslint-config/next.js";
1
1
+
import base from "@repo/eslint-config/next.js";
2
2
3
3
-
export default defineConfig(import.meta.dirname);
3
3
+
export default base;