Skip to content

Commit

Permalink
refactor(eslint, eslint-www): apply flat config (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
sixmen authored Oct 24, 2024
1 parent 533fe1e commit 6a92678
Show file tree
Hide file tree
Showing 32 changed files with 3,838 additions and 7,669 deletions.
7 changes: 0 additions & 7 deletions TypeScript/eslint-www/.eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion TypeScript/eslint-www/.prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
error.tsx
error.ts
10 changes: 8 additions & 2 deletions TypeScript/eslint-www/check-expected-result.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
style-guide/TypeScript/eslint-www/sample/error-react.tsx
5:2 error 'NoUndef' is not defined react/jsx-no-undef
10:3 error Your render method should have a return statement react/require-render-return
23:6 warning React Hook React.useEffect has a missing dependency: 'visible'. Either include it or remove the dependency array react-hooks/exhaustive-deps

style-guide/TypeScript/eslint-www/sample/error.ts
6:1 error Expected parentheses around arrow function argument arrow-parens
6:6 error Unsafe return of an `any` typed value @typescript-eslint/no-unsafe-return
6:6 error Unsafe return of a value of type `any` @typescript-eslint/no-unsafe-return
11:7 error Missing trailing comma comma-dangle
15:14 error Expected { after 'if' condition curly
19:5 error ["bar"] is better written in dot notation @typescript-eslint/dot-notation
Expand Down Expand Up @@ -35,5 +41,5 @@
105:21 warning 'unused_arg' is defined but never used. Allowed unused args must match /^_/u @typescript-eslint/no-unused-vars
106:9 warning 'unused_var' is assigned a value but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars

36 problems (33 errors, 3 warnings)
39 problems (35 errors, 4 warnings)
25 errors and 0 warnings potentially fixable with the `--fix` option.
62 changes: 0 additions & 62 deletions TypeScript/eslint-www/confusing-browser-globals.js

This file was deleted.

60 changes: 60 additions & 0 deletions TypeScript/eslint-www/confusing-browser-globals.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
export const restrictedGlobals = [
'addEventListener',
'blur',
'close',
'closed',
'confirm',
'defaultStatus',
'defaultstatus',
'event',
'external',
'find',
'focus',
'frameElement',
'frames',
'history',
'innerHeight',
'innerWidth',
'length',
'location',
'locationbar',
'menubar',
'moveBy',
'moveTo',
'name',
'onblur',
'onerror',
'onfocus',
'onload',
'onresize',
'onunload',
'open',
'opener',
'opera',
'outerHeight',
'outerWidth',
'pageXOffset',
'pageYOffset',
'parent',
'print',
'removeEventListener',
'resizeBy',
'resizeTo',
'screen',
'screenLeft',
'screenTop',
'screenX',
'screenY',
'scroll',
'scrollbars',
'scrollBy',
'scrollTo',
'scrollX',
'scrollY',
'self',
'status',
'statusbar',
'stop',
'toolbar',
'top',
];
16 changes: 16 additions & 0 deletions TypeScript/eslint-www/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import tseslint from 'typescript-eslint';
import baseConfig from './requiring-type-checking.mjs';

export default tseslint.config(...baseConfig, {
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
'import/resolver': {
typescript: true,
},
},
});
Loading

0 comments on commit 6a92678

Please sign in to comment.