mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 17:05:32 +02:00
feat(pnpm): replace npm with pnpm and setup cspell
This commit is contained in:
parent
199d83f25c
commit
d7e5bb6af1
22 changed files with 10923 additions and 14994 deletions
|
@ -1,14 +1,14 @@
|
|||
import { type Linter } from "eslint";
|
||||
import react from "eslint-plugin-react";
|
||||
import * as reactHooks from "eslint-plugin-react-hooks";
|
||||
import { type Linter } from 'eslint'
|
||||
import react from 'eslint-plugin-react'
|
||||
import * as reactHooks from 'eslint-plugin-react-hooks'
|
||||
|
||||
import { javascriptFiles, typescriptFiles } from "./shared";
|
||||
import { javascriptFiles, typescriptFiles } from './shared'
|
||||
|
||||
export const reactConfig: Linter.Config = {
|
||||
name: "eslint/react",
|
||||
name: 'eslint/react',
|
||||
files: [
|
||||
...typescriptFiles.filter((f) => f.includes("tsx")),
|
||||
...javascriptFiles.filter((f) => f.includes("jsx")),
|
||||
...typescriptFiles.filter(f => f.includes('tsx')),
|
||||
...javascriptFiles.filter(f => f.includes('jsx')),
|
||||
],
|
||||
plugins: {
|
||||
react,
|
||||
|
@ -16,44 +16,41 @@ export const reactConfig: Linter.Config = {
|
|||
rules: {
|
||||
...react.configs.recommended.rules,
|
||||
|
||||
"react/react-in-jsx-scope": "off", // Not needed in React 17+
|
||||
"react/prop-types": "off", // Using TypeScript
|
||||
"react/jsx-uses-react": "off",
|
||||
"react/jsx-uses-vars": "error",
|
||||
"react/no-unescaped-entities": "off",
|
||||
"react/jsx-key": "error",
|
||||
"react/jsx-no-useless-fragment": "error",
|
||||
"react/self-closing-comp": "error",
|
||||
"react/jsx-boolean-value": ["error", "never"],
|
||||
"react/jsx-curly-brace-presence": [
|
||||
"error",
|
||||
{ props: "never", children: "never" },
|
||||
],
|
||||
"react/function-component-definition": [
|
||||
"error",
|
||||
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
|
||||
'react/prop-types': 'off', // Using TypeScript
|
||||
'react/jsx-uses-react': 'off',
|
||||
'react/jsx-uses-vars': 'error',
|
||||
'react/no-unescaped-entities': 'off',
|
||||
'react/jsx-key': 'error',
|
||||
'react/jsx-no-useless-fragment': 'error',
|
||||
'react/self-closing-comp': 'error',
|
||||
'react/jsx-boolean-value': ['error', 'never'],
|
||||
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
|
||||
'react/function-component-definition': [
|
||||
'error',
|
||||
{
|
||||
namedComponents: "arrow-function",
|
||||
unnamedComponents: "arrow-function",
|
||||
namedComponents: 'arrow-function',
|
||||
unnamedComponents: 'arrow-function',
|
||||
},
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "18.2", // React version
|
||||
version: '18.2', // React version
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export const reactHooksConfig: Linter.Config = {
|
||||
name: "eslint/react-hooks",
|
||||
name: 'eslint/react-hooks',
|
||||
files: [
|
||||
...typescriptFiles.filter((f) => f.includes("tsx")),
|
||||
...javascriptFiles.filter((f) => f.includes("jsx")),
|
||||
...typescriptFiles.filter(f => f.includes('tsx')),
|
||||
...javascriptFiles.filter(f => f.includes('jsx')),
|
||||
],
|
||||
plugins: {
|
||||
"react-hooks": reactHooks,
|
||||
'react-hooks': reactHooks,
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue