Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
coverage/
__tests__
__tests__
node_modules/
dist/
.github/
.vscode/
.husky/
public/
*.config.js
*.config.ts
*.d.ts
vite-env.d.ts
38 changes: 0 additions & 38 deletions .eslintrc.json

This file was deleted.

133 changes: 133 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import * as importPlugin from 'eslint-plugin-import';
import securityPlugin from 'eslint-plugin-security';
import sortKeysFixPlugin from 'eslint-plugin-sort-keys-fix';

export default tseslint.config(
// Base ESLint recommended configuration
eslint.configs.recommended,

// TypeScript ESLint recommended configuration
...tseslint.configs.recommended,
...tseslint.configs.stylistic,

// Ignore patterns (replaces .eslintignore)
{
ignores: [
'node_modules/**',
'dist/**',
'coverage/**',
'.github/**',
'.vscode/**',
'.husky/**',
'public/**',
'**/*.config.js',
'**/*.config.ts',
'**/*.d.ts',
'vite-env.d.ts',
'__tests__/**'
]
},

// Configure for React
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'jsx-a11y': jsxA11yPlugin,
import: importPlugin,
security: securityPlugin,
'sort-keys-fix': sortKeysFixPlugin,
},
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
},
rules: {
// Disable problematic rules that cause circular dependencies
'import/order': 'off',
'import/no-duplicates': 'off',

// React rules
'react/jsx-sort-props': 'off', // Disable for now to avoid circular fixes
'react/jsx-runtime': 'off',
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',

// React hooks rules - relaxed for now
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',

// Accessibility rules
'jsx-a11y/alt-text': 'warn',
'jsx-a11y/anchor-has-content': 'warn',
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/aria-role': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',

// Sort keys rules - relaxed to avoid circular issues
'sort-keys': 'off',
'sort-keys-fix/sort-keys-fix': 'off',

// Security rules - turned to warnings to avoid breaking changes
'security/detect-object-injection': 'warn',
'security/detect-non-literal-regexp': 'warn',
'security/detect-possible-timing-attacks': 'warn',

// Disable some ESLint rules that might conflict
'no-useless-escape': 'warn',
},
},

// Special configuration for TypeScript files
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
// Disable ESLint rules that TypeScript ESLint handles better
'no-undef': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
}],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/consistent-type-definitions': 'off', // Disable to avoid breaking changes
'@typescript-eslint/consistent-indexed-object-style': 'off', // Disable to avoid breaking changes
'@typescript-eslint/no-wrapper-object-types': 'off', // Disable to avoid breaking changes
},
},

// Test files
{
files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],
rules: {
// Relaxed rules for tests
'@typescript-eslint/no-explicit-any': 'off',
'security/detect-object-injection': 'off',
'sort-keys': 'off',
'sort-keys-fix/sort-keys-fix': 'off',
},
}
);
50 changes: 11 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"preview": "vite preview",
"format": "pnpm prettier --write ./src/components/*.{ts,tsx}",
"test": "pnpm vitest --config ./vitest.config.ts --coverage",
"lint": "pnpm eslint ./src/components/**/*.{ts,tsx}",
"fix-lint": "pnpm eslint ./src/components/**/*.{ts,tsx} --fix",
"lint": "pnpm eslint \"./src/**/*.{ts,tsx,js,jsx}\"",
"fix-lint": "pnpm eslint \"./src/**/*.{ts,tsx,js,jsx}\" --fix",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production --node-env=production",
"analyze": "webpack --mode=production --node-env=production --env analyze",
Expand Down Expand Up @@ -59,46 +59,14 @@
"pre-commit": "pretty-quick --staged"
}
},
"eslintConfig": {
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"standard",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"no-use-before-define": "off",
"react/prop-types": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
},
"main": "dist/react-wizardry.js",
"devDependencies": {
"@babel/core": "^7.19.6",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.19.4",
"@babel/preset-react": "^7.18.6",
"@babel/runtime": "^7.20.0",
"@eslint/js": "^9.28.0",
"@swc/core": "^1.11.31",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
Expand All @@ -120,16 +88,19 @@
"cssnano": "^7.0.7",
"dotenv-webpack": "^8.1.0",
"esbuild-loader": "^2.20.0",
"eslint": "^8.26.0",
"eslint": "^9.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-n": "^15.4.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-security": "^1.5.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"glob": "^11.0.2",
"husky": "^8.0.1",
"jsdom": "^20.0.2",
"mini-css-extract-plugin": "^2.6.1",
Expand All @@ -150,6 +121,7 @@
"terser-webpack-plugin": "^5.3.6",
"ts-loader": "^9.4.1",
"typescript": "^4.8.4",
"typescript-eslint": "^8.33.1",
"vite": "^6.3.5",
"vitest": "^3.2.2",
"webpack": "^5.99.9",
Expand Down
Loading