diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 8055da54e..000000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -**/dist -**/node_modules -**/protos -**/proto -**/coverage -**/storybook-static diff --git a/.vscode/settings.json b/.vscode/settings.json index 08d152b02..0bb9ccf6a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,13 @@ { "typescript.tsdk": "node_modules/typescript/lib", "npm.packageManager": "pnpm", + "eslint.useESLintClass": true, "eslint.workingDirectories": [ + "./packages/colors", + "./packages/icons", + "./packages/components", + "./packages/status-js", + "./apps/connector", { "mode": "auto", "#comment": "See https://github.com/microsoft/vscode-eslint/issues/1161 for reason (i.e. multiple .eslintrc config files)" diff --git a/apps/connector/.eslintrc.js b/apps/connector/.eslintrc.js deleted file mode 100644 index efd303c14..000000000 --- a/apps/connector/.eslintrc.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - root: true, - overrides: [ - { - files: ['*.ts', '*.tsx'], - extends: ['@status-im/eslint-config', 'plugin:tailwindcss/recommended'], - - rules: { - 'no-constant-binary-expression': 'error', - 'no-restricted-globals': ['error', 'process'], - 'jsx-a11y/alt-text': [ - 1, - { - img: [], - }, - ], - }, - }, - { - // parser: 'esprima', - files: ['*.mjs'], - // env: { - // browser: true, - // es2021: true, - // }, - // extends: ['eslint:recommended', 'plugin:import/recommended'], - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - }, - }, - { - files: ['*.js'], - parserOptions: { - ecmaVersion: 'latest', - }, - }, - ], -} diff --git a/apps/connector/eslint.config.mjs b/apps/connector/eslint.config.mjs new file mode 100644 index 000000000..2fb9450b0 --- /dev/null +++ b/apps/connector/eslint.config.mjs @@ -0,0 +1,42 @@ +import config, { tailwindcssConfig } from '@status-im/eslint-config' + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + { + ignores: ['dist', 'index.js', 'index.es.js'], + }, + { + files: ['*.ts', '*.tsx'], + ...config, + ...tailwindcssConfig, + rules: { + ...config.rules, + ...tailwindcssConfig.rules, + 'no-constant-binary-expression': 'error', + 'no-restricted-globals': ['error', 'process'], + 'jsx-a11y/alt-text': [ + 1, + { + img: [], + }, + ], + }, + }, + { + files: ['*.js'], + languageOptions: { + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + }, + }, + { + files: ['*.js'], + languageOptions: { + parserOptions: { + ecmaVersion: 'latest', + }, + }, + }, +] diff --git a/apps/connector/package.json b/apps/connector/package.json index 845e726a3..bd3f99c2a 100644 --- a/apps/connector/package.json +++ b/apps/connector/package.json @@ -25,7 +25,7 @@ "@plasmohq/storage": "^1.11.0", "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-switch": "^1.1.0", - "@status-im/colors": "^0.4.0", + "@status-im/colors": "workspace:*", "cva": "^1.0.0-beta.1", "ethers": "^6.13.0", "plasmo": "0.88.0", @@ -37,7 +37,7 @@ "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "4.1.1", "@parcel/bundler-experimental": "^2.7.0", - "@status-im/eslint-config": "^0.3.0", + "@status-im/eslint-config": "workspace:*", "@tailwindcss/typography": "^0.5.13", "@types/chrome": "0.0.258", "@types/node": "20.11.5", @@ -45,7 +45,6 @@ "@types/react-dom": "18.2.18", "autoprefixer": "^10.4.19", "husky": "^8.0.3", - "lint-staged": "^13.2.0", "postcss": "^8.4.38", "prettier": "3.2.4", "prettier-plugin-tailwindcss": "^0.6.1", diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..59520d062 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,13 @@ +/** @type {import('eslint').Linter.Config[]} */ +export default [ + { + ignores: [ + '**/dist', + '**/node_modules', + '**/protos', + '**/proto', + '**/coverage', + '**/storybook-static', + ], + }, +] diff --git a/package.json b/package.json index f0c974463..f8bbda640 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "prepare": "husky install", "test": "turbo run test --filter=@status-im/* -- --run", "dev": "turbo run dev --filter=@status-im/* --parallel", - "build": "turbo run build --filter=@status-im/* && node --version", + "build": "turbo run build --filter=@status-im/*", "lint": "turbo run lint --filter=@status-im/* --filter=web", "typecheck": "turbo run typecheck", "format": "prettier --write .", @@ -32,8 +32,9 @@ "@status-im/eslint-config": "workspace:*", "@tsconfig/strictest": "^2.0.0", "@types/prettier": "^2.7.2", + "eslint": "^9.14.0", "husky": "^8.0.3", - "lint-staged": "^13.2.0", + "lint-staged": "^15.2.10", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.6", "@types/react": "^18.0.33", diff --git a/packages/colors/.eslintrc b/packages/colors/.eslintrc deleted file mode 100644 index bef97c7d5..000000000 --- a/packages/colors/.eslintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": ["@status-im/eslint-config"] -} diff --git a/packages/colors/eslint.config.mjs b/packages/colors/eslint.config.mjs new file mode 100644 index 000000000..d3d932216 --- /dev/null +++ b/packages/colors/eslint.config.mjs @@ -0,0 +1,4 @@ +import config from '@status-im/eslint-config' + +/** @type {import('eslint').Linter.Config[]} */ +export default [...config] diff --git a/packages/components/.eslintrc b/packages/components/.eslintrc deleted file mode 100644 index 4559223f0..000000000 --- a/packages/components/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "root": true, - "extends": ["plugin:tailwindcss/recommended", "@status-im/eslint-config"], - "rules": { - "tailwindcss/classnames-order": "off" - } -} diff --git a/packages/components/eslint.config.mjs b/packages/components/eslint.config.mjs new file mode 100644 index 000000000..839407f05 --- /dev/null +++ b/packages/components/eslint.config.mjs @@ -0,0 +1,9 @@ +import config, { tailwindcssConfig } from '@status-im/eslint-config' + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + ...config, + { + ...tailwindcssConfig, + }, +] diff --git a/packages/components/package.json b/packages/components/package.json index 4c266f7da..5affe7029 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -31,7 +31,7 @@ "preinstall": "npx only-allow pnpm", "dev": "vite build --watch --mode development", "build": "vite build", - "postbuild": "pnpm build:types && node --version", + "postbuild": "pnpm build:types", "build:types": "tsc --noEmit false --emitDeclarationOnly", "typecheck": "tsc", "lint": "eslint src", diff --git a/packages/components/src/avatar/avatar.stories.tsx b/packages/components/src/avatar/avatar.stories.tsx index fb68a6e3a..2f18c2e55 100644 --- a/packages/components/src/avatar/avatar.stories.tsx +++ b/packages/components/src/avatar/avatar.stories.tsx @@ -14,6 +14,7 @@ const sizesAvatar = { } const renderVariant = (variant: AvatarProps['type']) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const content = (props: any) => { const sizes = sizesAvatar[variant] @@ -47,7 +48,7 @@ const meta = { }, render: props => ( -