Skip to content

Commit 6a92678

Browse files
authored
refactor(eslint, eslint-www): apply flat config (#74)
1 parent 533fe1e commit 6a92678

32 files changed

+3838
-7669
lines changed

TypeScript/eslint-www/.eslintrc.json

-7
This file was deleted.

TypeScript/eslint-www/.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
error.tsx
1+
error.ts

TypeScript/eslint-www/check-expected-result.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
style-guide/TypeScript/eslint-www/sample/error-react.tsx
2+
5:2 error 'NoUndef' is not defined react/jsx-no-undef
3+
10:3 error Your render method should have a return statement react/require-render-return
4+
23:6 warning React Hook React.useEffect has a missing dependency: 'visible'. Either include it or remove the dependency array react-hooks/exhaustive-deps
5+
6+
style-guide/TypeScript/eslint-www/sample/error.ts
17
6:1 error Expected parentheses around arrow function argument arrow-parens
2-
6:6 error Unsafe return of an `any` typed value @typescript-eslint/no-unsafe-return
8+
6:6 error Unsafe return of a value of type `any` @typescript-eslint/no-unsafe-return
39
11:7 error Missing trailing comma comma-dangle
410
15:14 error Expected { after 'if' condition curly
511
19:5 error ["bar"] is better written in dot notation @typescript-eslint/dot-notation
@@ -35,5 +41,5 @@
3541
105:21 warning 'unused_arg' is defined but never used. Allowed unused args must match /^_/u @typescript-eslint/no-unused-vars
3642
106:9 warning 'unused_var' is assigned a value but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
3743

38-
36 problems (33 errors, 3 warnings)
44+
39 problems (35 errors, 4 warnings)
3945
25 errors and 0 warnings potentially fixable with the `--fix` option.

TypeScript/eslint-www/confusing-browser-globals.js

-62
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
export const restrictedGlobals = [
2+
'addEventListener',
3+
'blur',
4+
'close',
5+
'closed',
6+
'confirm',
7+
'defaultStatus',
8+
'defaultstatus',
9+
'event',
10+
'external',
11+
'find',
12+
'focus',
13+
'frameElement',
14+
'frames',
15+
'history',
16+
'innerHeight',
17+
'innerWidth',
18+
'length',
19+
'location',
20+
'locationbar',
21+
'menubar',
22+
'moveBy',
23+
'moveTo',
24+
'name',
25+
'onblur',
26+
'onerror',
27+
'onfocus',
28+
'onload',
29+
'onresize',
30+
'onunload',
31+
'open',
32+
'opener',
33+
'opera',
34+
'outerHeight',
35+
'outerWidth',
36+
'pageXOffset',
37+
'pageYOffset',
38+
'parent',
39+
'print',
40+
'removeEventListener',
41+
'resizeBy',
42+
'resizeTo',
43+
'screen',
44+
'screenLeft',
45+
'screenTop',
46+
'screenX',
47+
'screenY',
48+
'scroll',
49+
'scrollbars',
50+
'scrollBy',
51+
'scrollTo',
52+
'scrollX',
53+
'scrollY',
54+
'self',
55+
'status',
56+
'statusbar',
57+
'stop',
58+
'toolbar',
59+
'top',
60+
];
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import tseslint from 'typescript-eslint';
2+
import baseConfig from './requiring-type-checking.mjs';
3+
4+
export default tseslint.config(...baseConfig, {
5+
languageOptions: {
6+
parserOptions: {
7+
projectService: true,
8+
tsconfigRootDir: import.meta.dirname,
9+
},
10+
},
11+
settings: {
12+
'import/resolver': {
13+
typescript: true,
14+
},
15+
},
16+
});

0 commit comments

Comments
 (0)