mirror of
https://github.com/zen-browser/www.git
synced 2025-07-08 01:10:02 +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,21 +1,21 @@
|
|||
import { type Linter } from "eslint";
|
||||
import { type Linter } from 'eslint'
|
||||
|
||||
import { configFiles } from "./shared";
|
||||
import { configFiles } from './shared'
|
||||
|
||||
export const configFilesConfig: Linter.Config = {
|
||||
name: "eslint/config-files",
|
||||
name: 'eslint/config-files',
|
||||
files: configFiles,
|
||||
rules: {
|
||||
"no-console": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"import/no-default-export": "off",
|
||||
"import/default": "off", // Allow missing default exports in config files
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/no-unsafe-return": "off",
|
||||
"@typescript-eslint/no-unsafe-argument": "off",
|
||||
"prefer-const": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
'no-console': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
'import/no-default-export': 'off',
|
||||
'import/default': 'off', // Allow missing default exports in config files
|
||||
'@typescript-eslint/no-unsafe-assignment': 'off',
|
||||
'@typescript-eslint/no-unsafe-member-access': 'off',
|
||||
'@typescript-eslint/no-unsafe-call': 'off',
|
||||
'@typescript-eslint/no-unsafe-return': 'off',
|
||||
'@typescript-eslint/no-unsafe-argument': 'off',
|
||||
'prefer-const': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
21
.eslint/cspell.ts
Normal file
21
.eslint/cspell.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import cspellPlugin from '@cspell/eslint-plugin'
|
||||
import { type Linter } from 'eslint'
|
||||
|
||||
import cspellJson from '../cspell.json'
|
||||
import { sharedFiles } from './shared'
|
||||
|
||||
export const cspellConfig: Linter.Config = {
|
||||
name: 'eslint/cspell',
|
||||
files: sharedFiles,
|
||||
ignores: cspellJson.ignorePaths,
|
||||
plugins: { '@cspell': cspellPlugin },
|
||||
rules: {
|
||||
'@cspell/spellchecker': [
|
||||
'warn',
|
||||
{
|
||||
configFile: new URL('../cspell.json', import.meta.url).toString(),
|
||||
cspell: {},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -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