Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
morewings committed Nov 30, 2023
1 parent ff46d48 commit f06e8e0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 21 deletions.
59 changes: 39 additions & 20 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
module.exports = {
root: true,
extends: ['plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:ssr-friendly/recommended', 'plugin:storybook/recommended', 'plugin:prettier/recommended'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:ssr-friendly/recommended',
'plugin:storybook/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
Expand All @@ -16,16 +22,19 @@ module.exports = {
* Allow empty arrow functions `() => {}`, while keeping other empty functions restricted
* @see https://eslint.org/docs/latest/rules/no-empty-function#allow-arrowfunctions
*/
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }],
'@typescript-eslint/no-empty-function': [
'error',
{allow: ['arrowFunctions']},
],
'@typescript-eslint/ban-ts-comment': 1,
'no-const-assign': 'error',
/** Restrict imports from devDependencies since they are not included in library build. peerDependencies are ok */
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: false,
peerDependencies: true
}
peerDependencies: true,
},
],
/**
* Enforce import order with empty lines between import group
Expand All @@ -38,16 +47,16 @@ module.exports = {
'builtin',
'external',
'internal',
['parent', 'sibling', 'index']
['parent', 'sibling', 'index'],
],
pathGroups: [
{
pattern: '@/**',
group: 'internal'
}
group: 'internal',
},
],
'newlines-between': 'always'
}
'newlines-between': 'always',
},
],
/**
* Disallow combined module and type imports like this `import React, {FC} from 'react'`.
Expand All @@ -56,27 +65,37 @@ module.exports = {
*/
'@typescript-eslint/consistent-type-imports': 'error',
'import/no-cycle': 'error',
'prettier/prettier': ['error', {
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": false,
"jsxBracketSameLine": true,
"arrowParens": "avoid"
}]
'prettier/prettier': [
'error',
{
semi: true,
singleQuote: true,
jsxSingleQuote: false,
trailingComma: 'es5',
bracketSpacing: false,
jsxBracketSameLine: true,
arrowParens: 'avoid',
},
],
},
overrides: [
{
/* Allow devDependencies imports for tests and config files */
files: ['*.js'],
files: ['*.js', '*.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 0,
},
},
{
/* Allow devDependencies imports for tests and config files */
files: ['**/*.spec.*', '**/testUtils/*.*', '**/*.js', '**/setupTests.ts', '**/*.stories.*'],
files: [
'**/*.spec.*',
'**/testUtils/*.*',
'**/*.js',
'**/*.cjs',
'**/setupTests.ts',
'**/*.stories.*',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"include": [
"src",
"**.js"
"**.js",
"**.cjs"
]
}

0 comments on commit f06e8e0

Please sign in to comment.