-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade lint/prettier for new TS version (#1099)
* chore: upgrade lint and prettier for new TS version * fix: all lint/prettier errors * chore: update the gosling schema
- Loading branch information
Showing
38 changed files
with
1,533 additions
and
744 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
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
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
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,73 @@ | ||
import globals from 'globals'; | ||
import pluginJs from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
import tsparser from '@typescript-eslint/parser'; | ||
import pluginReact from 'eslint-plugin-react'; | ||
import eslintPluginPrettierRecommed from 'eslint-plugin-prettier/recommended'; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
eslintPluginPrettierRecommed, | ||
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] }, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
pluginReact.configs.flat.recommended, | ||
{ ignores: ['node_modules', 'build', 'dist', 'public'] }, | ||
{ | ||
languageOptions: { | ||
globals: globals.browser, | ||
parser: tsparser, | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
ecmaVersion: 6, | ||
sourceType: 'module' | ||
} | ||
} | ||
}, | ||
{ | ||
settings: { | ||
react: { | ||
version: "detect" | ||
} | ||
} | ||
}, | ||
{ | ||
rules: { | ||
'prettier/prettier': 'warn', | ||
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/prefer-for-of': 'error', | ||
'@typescript-eslint/no-for-in-array': 'error', | ||
'@typescript-eslint/no-require-imports': 'error', | ||
'@typescript-eslint/no-empty-function': 'off', // we need this in higlass plugin track | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-namespace': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'no-unused-vars': 'off', // must disable the base rule as it can report incorrect errors | ||
// https://www.executeprogram.com/blog/the-code-is-the-to-do-list | ||
'no-warning-comments': ['error', { terms: ['xxx'], location: 'anywhere' }], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
vars: 'all', | ||
args: 'after-used', | ||
ignoreRestSiblings: true | ||
} | ||
], | ||
// https://eslint.org/docs/rules/ | ||
'linebreak-style': ['error', 'unix'], | ||
'no-console': ['error', { allow: ['warn', 'error'] }], | ||
'no-trailing-spaces': 'error', | ||
'no-irregular-whitespace': ['error', { skipComments: true }], | ||
'no-alert': 'error', | ||
'prefer-const': 'error', | ||
'no-case-declarations': 'warn', | ||
'no-return-assign': 'error', | ||
'no-useless-call': 'error', | ||
'no-shadow': 'off', // 'error', // we could enable this later | ||
'no-useless-concat': 'error', | ||
'prefer-template': 'error' | ||
} | ||
} | ||
]; |
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.