-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #429 from mrholek/main
Upgrade ESLint to v9.x and update prettier configuration
- Loading branch information
Showing
8 changed files
with
124 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,104 @@ | ||
import eslint from '@eslint/js' | ||
import tsParser from '@typescript-eslint/parser' | ||
import eslintPluginUnicorn from 'eslint-plugin-unicorn' | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' | ||
import eslintPluginReact from 'eslint-plugin-react' | ||
import eslintPluginReactHooks from 'eslint-plugin-react-hooks' | ||
import globals from 'globals' | ||
import typescriptEslint from 'typescript-eslint' | ||
|
||
export default typescriptEslint.config( | ||
{ ignores: ['**/*.d.ts', '**/coverage', '**/dist', 'eslint.config.mjs'] }, | ||
{ | ||
extends: [ | ||
eslint.configs.recommended, | ||
...typescriptEslint.configs.recommended, | ||
eslintPluginUnicorn.configs['flat/recommended'], | ||
eslintPluginReact.configs.flat.recommended, | ||
eslintPluginReact.configs.flat['jsx-runtime'], | ||
], | ||
plugins: { | ||
'react-hooks': eslintPluginReactHooks, | ||
}, | ||
files: ['packages/**/src/**/*.{js,ts,tsx}'], | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
}, | ||
parser: tsParser, | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}, | ||
settings: { | ||
react: { | ||
pragma: 'React', | ||
version: 'detect', | ||
}, | ||
}, | ||
rules: { | ||
...eslintPluginReactHooks.configs.recommended.rules, | ||
'no-console': 'off', | ||
'no-debugger': 'off', | ||
'unicorn/filename-case': 'off', | ||
'unicorn/no-array-for-each': 'off', | ||
'unicorn/no-null': 'off', | ||
'unicorn/prefer-dom-node-append': 'off', | ||
'unicorn/prefer-export-from': 'off', | ||
'unicorn/prefer-query-selector': 'off', | ||
'unicorn/prevent-abbreviations': 'off', | ||
'vue/require-default-prop': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.mjs'], | ||
languageOptions: { | ||
globals: { | ||
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), | ||
...globals.node, | ||
}, | ||
|
||
ecmaVersion: 5, | ||
sourceType: 'module', | ||
}, | ||
}, | ||
{ | ||
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'], | ||
languageOptions: { | ||
globals: { | ||
...globals.jest, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['packages/docs/build/**'], | ||
languageOptions: { | ||
globals: { | ||
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), | ||
...globals.node, | ||
}, | ||
|
||
ecmaVersion: 5, | ||
sourceType: 'commonjs', | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'no-console': 'off', | ||
'unicorn/prefer-module': 'off', | ||
'unicorn/prefer-top-level-await': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['packages/docs/**'], | ||
rules: { | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'unicorn/prefer-module': 'off', | ||
}, | ||
}, | ||
eslintPluginPrettierRecommended, | ||
) |
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,13 @@ | ||
/** | ||
* @see https://prettier.io/docs/en/configuration.html | ||
* @type {import("prettier").Config} | ||
*/ | ||
const config = { | ||
printWidth: 100, | ||
semi: false, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'es5', | ||
}; | ||
|
||
export default config; |