Skip to content

Commit

Permalink
ci: change eslint settings
Browse files Browse the repository at this point in the history
  • Loading branch information
1ncounter committed Apr 3, 2024
1 parent 5206715 commit 1149044
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 54 deletions.
18 changes: 0 additions & 18 deletions .eslintignore

This file was deleted.

60 changes: 27 additions & 33 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
import stylistic from '@stylistic/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import tseslint from 'typescript-eslint'
import js from '@eslint/js';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';

export default [
js.configs.recommended,
{
files: ['**/src/**/*.{ts?(x),js?(x)}'],
plugins: {
'@stylistic': stylistic,
'react-hooks': reactHooks,
},
languageOptions: {
parser: tsParser,
},
rules: {
'@stylistic/indent': ['error', 2],
"@stylistic/indent-binary-ops": ["error", 2],
'@stylistic/max-len': ["error", { "tabWidth": 2 }],
'@stylistic/no-tabs': "error",
'@stylistic/quotes': ["error", "single"],
"@stylistic/jsx-pascal-case": [2],
"@stylistic/jsx-indent": [2, 2, { checkAttributes: true, indentLogicalExpressions: true }],

'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
},
export default tseslint.config({
files: ['packages/*/src/**/*.{ts?(x),js?(x)}'],
ignores: ["**/*.test.ts"],
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
],
plugins: {
'@stylistic': stylistic,
'react-hooks': reactHooks,
'react-refresh': reactRefresh
},
{
files: ['**/src/**/*.{tsx,jsx}'],
plugins: {
'react-refresh': reactRefresh,
},
rules: {
'react-refresh/only-export-components': 'warn',
},
rules: {
'@stylistic/indent': ['error', 2],
'@stylistic/indent-binary-ops': ['error', 2],
'@stylistic/max-len': ['error', { tabWidth: 2 }],
'@stylistic/no-tabs': 'error',
'@stylistic/quotes': ['error', 'single'],
'@stylistic/jsx-pascal-case': [2],
'@stylistic/jsx-indent': [2, 2, { checkAttributes: true, indentLogicalExpressions: true }],
'@stylistic/semi': ['error', 'always'],

'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies

'react-refresh/only-export-components': 'warn',
},
];
})
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"scripts": {
"playground": "pnpm --filter playground dev",
"test": "pnpm -r test",
"build": "pnpm -r build",
"build": "node ./scripts/build.js",
"clean": "rimraf ./packages/*/dist",
"clean:lib": "rimraf ./node_modules ./packages/*/node_modules",
"lint": "eslint --cache --no-warn-ignored",
"lint": "eslint . --cache",
"pub": "npm run watchdog:build && lerna publish patch --yes --force-publish --exact --no-changelog",
"pub:minor": "npm run watchdog:build && lerna publish minor --yes --force-publish --exact --no-changelog",
"pub:major": "npm run watchdog:build && lerna publish major --yes --force-publish --exact --no-changelog",
Expand All @@ -30,16 +30,19 @@
"@stylistic/eslint-plugin": "^1.7.0",
"@types/node": "^20.11.30",
"@types/react-router": "5.1.18",
"@typescript-eslint/parser": "^7.4.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"execa": "^8.0.1",
"husky": "^9.0.11",
"less": "^4.2.0",
"lint-staged": "^15.2.2",
"minimist": "^1.2.8",
"rimraf": "^5.0.2",
"rollup": "^4.13.0",
"typescript": "^5.4.2",
"typescript-eslint": "^7.5.0",
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
Expand Down

0 comments on commit 1149044

Please sign in to comment.