feat(pnpm): replace npm with pnpm and setup cspell

This commit is contained in:
Shintaro Jokagi 2025-06-02 13:11:57 +12:00
parent 199d83f25c
commit d7e5bb6af1
No known key found for this signature in database
GPG key ID: 0DDF8FA44C9A0DA8
22 changed files with 10923 additions and 14994 deletions

View file

@ -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,
},
};
}