chore: server code formatting
This commit is contained in:
parent
aedabcbdee
commit
68517170e2
234 changed files with 9824 additions and 6195 deletions
|
|
@ -5,13 +5,21 @@ import json from '@eslint/json'
|
|||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
import reactCompiler from 'eslint-plugin-react-compiler'
|
||||
import eslintConfigPrettier from 'eslint-config-prettier/flat'
|
||||
import pluginJest from 'eslint-plugin-jest'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['**/build', '**/package.json', '**/package-lock.json']),
|
||||
globalIgnores([
|
||||
'**/build',
|
||||
'**/package.json',
|
||||
'**/package-lock.json',
|
||||
'**/currencies.json',
|
||||
'**/countries.json',
|
||||
'**/languages.json',
|
||||
]),
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs,jsx}'],
|
||||
plugins: { js },
|
||||
extends: ['js/recommended']
|
||||
extends: ['js/recommended'],
|
||||
},
|
||||
{
|
||||
files: ['packages/admin-ui/**/*.{js,mjs,jsx}'],
|
||||
|
|
@ -19,18 +27,18 @@ export default defineConfig([
|
|||
sourceType: 'module',
|
||||
globals: {
|
||||
...globals.browser,
|
||||
process: 'readonly'
|
||||
}
|
||||
}
|
||||
process: 'readonly',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['packages/server/**/*.{js,cjs}'],
|
||||
languageOptions: { sourceType: 'commonjs', globals: globals.node }
|
||||
languageOptions: { sourceType: 'commonjs', globals: globals.node },
|
||||
},
|
||||
{
|
||||
...pluginReact.configs.flat.recommended,
|
||||
settings: { react: { version: 'detect' } },
|
||||
files: ['packages/admin-ui/**/*.{jsx,js}']
|
||||
files: ['packages/admin-ui/**/*.{jsx,js}'],
|
||||
},
|
||||
{ ...reactCompiler.configs.recommended },
|
||||
eslintConfigPrettier,
|
||||
|
|
@ -38,14 +46,29 @@ export default defineConfig([
|
|||
files: ['**/*.json'],
|
||||
plugins: { json },
|
||||
language: 'json/json',
|
||||
extends: ['json/recommended']
|
||||
extends: ['json/recommended'],
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
'react/prop-types': 'off',
|
||||
'react/display-name': 'off',
|
||||
'react/no-unescaped-entities': 'off',
|
||||
'react-compiler/react-compiler': 'warn'
|
||||
}
|
||||
}
|
||||
'react-compiler/react-compiler': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
// update this to match your test files
|
||||
files: ['**/*.spec.js', '**/*.test.js'],
|
||||
plugins: { jest: pluginJest },
|
||||
languageOptions: {
|
||||
globals: pluginJest.environments.globals.globals,
|
||||
},
|
||||
rules: {
|
||||
'jest/no-disabled-tests': 'warn',
|
||||
'jest/no-focused-tests': 'error',
|
||||
'jest/no-identical-title': 'error',
|
||||
'jest/prefer-to-have-length': 'warn',
|
||||
'jest/valid-expect': 'error',
|
||||
},
|
||||
},
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue