-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] upgrade to ESLint 9 (#58)
- Loading branch information
Showing
17 changed files
with
600 additions
and
292 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- icon: visualstudio | ||
label: 'GitHub.dev' | ||
message: 'PR-$prNumber' | ||
color: 'blue' | ||
url: 'https://github.dev/$owner/$repo/pull/$prNumber' | ||
|
||
- icon: github | ||
label: 'GitHub codespaces' | ||
message: 'PR-$prNumber' | ||
color: 'black' | ||
url: 'https://codespaces.new/$owner/$repo/pull/$prNumber' | ||
|
||
- icon: git | ||
label: 'GitPod.io' | ||
message: 'PR-$prNumber' | ||
color: 'orange' | ||
url: 'https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This configuration file was automatically generated by Gitpod. | ||
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) | ||
# and commit this file to your remote git repository to share the goodness with others. | ||
|
||
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart | ||
|
||
vscode: | ||
extensions: | ||
- yzhang.markdown-all-in-one | ||
- jock.svg | ||
- redhat.vscode-yaml | ||
- clinyong.vscode-css-modules | ||
- akamud.vscode-caniuse | ||
- visualstudioexptteam.intellicode-api-usage-examples | ||
- pflannery.vscode-versionlens | ||
- christian-kohler.npm-intellisense | ||
- esbenp.prettier-vscode | ||
- rangav.vscode-thunder-client | ||
- eamodio.gitlens | ||
- github.vscode-pull-request-github | ||
- github.vscode-github-actions | ||
tasks: | ||
- init: pnpm i | ||
command: pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
.eslintrc.json | ||
.* | ||
eslint.config.mjs | ||
vite.config.ts | ||
.parcel* | ||
docs/ | ||
preview/ | ||
api-extractor.json | ||
stories/ | ||
.storybook/ | ||
storybook-static/ | ||
.vscode/ | ||
.husky/ | ||
.github/ | ||
storybook-static/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// @ts-check | ||
import { fixupPluginRules } from '@eslint/compat'; | ||
import eslint from '@eslint/js'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import reactPlugin from 'eslint-plugin-react'; | ||
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'; | ||
import globals from 'globals'; | ||
import tsEslint from 'typescript-eslint'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
export default tsEslint.config( | ||
// register all of the plugins up-front | ||
{ | ||
plugins: { | ||
'@typescript-eslint': tsEslint.plugin, | ||
// @ts-expect-error https://github.com/jsx-eslint/eslint-plugin-react/issues/3699 | ||
react: fixupPluginRules(reactPlugin), | ||
'simple-import-sort': simpleImportSortPlugin | ||
} | ||
}, | ||
// config with just ignores is the replacement for `.eslintignore` | ||
{ ignores: ['**/node_modules/**', '**/dist/**', '**/.parcel-cache/**'] }, | ||
|
||
// extends ... | ||
eslint.configs.recommended, | ||
...tsEslint.configs.recommended, | ||
|
||
// base config | ||
{ | ||
languageOptions: { | ||
globals: { ...globals.es2020, ...globals.browser, ...globals.node }, | ||
parserOptions: { | ||
projectService: true, | ||
tsconfigRootDir, | ||
warnOnUnsupportedTypeScriptVersion: false | ||
} | ||
}, | ||
rules: { | ||
'simple-import-sort/exports': 'error', | ||
'simple-import-sort/imports': 'error', | ||
'react/jsx-no-target-blank': 'warn', | ||
'react/jsx-sort-props': [ | ||
'error', | ||
{ | ||
reservedFirst: true, | ||
shorthandLast: true, | ||
callbacksLast: true, | ||
noSortAlphabetically: true | ||
} | ||
], | ||
'@typescript-eslint/no-unused-vars': 'warn', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-empty-object-type': 'off', | ||
'@typescript-eslint/no-unsafe-declaration-merging': 'warn' | ||
} | ||
}, | ||
{ | ||
files: ['**/*.js'], | ||
extends: [tsEslint.configs.disableTypeChecked], | ||
rules: { | ||
// turn off other type-aware rules | ||
'@typescript-eslint/internal/no-poorly-typed-ts-props': 'off', | ||
|
||
// turn off rules that don't apply to JS code | ||
'@typescript-eslint/explicit-function-return-type': 'off' | ||
} | ||
}, | ||
eslintConfigPrettier | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
cb69f54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for idea-react ready!
✅ Preview
https://idea-react-3g595z0b6-stevending1sts-projects.vercel.app
Built with commit cb69f54.
This pull request is being automatically deployed with vercel-action