Skip to content

Commit

Permalink
chore(eslint): Upgrade typescript-eslint (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan authored and Rocket.Chat committed Oct 15, 2024
1 parent fc33aa8 commit 07c4055
Show file tree
Hide file tree
Showing 38 changed files with 527 additions and 806 deletions.
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn update-readme
14 changes: 7 additions & 7 deletions packages/css-in-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
"docs": "typedoc"
},
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"@rocket.chat/eslint-config-alt": "^0.31.25",
"@rocket.chat/prettier-config": "^0.31.25",
"@rollup/plugin-commonjs": "~21.0.3",
"@rollup/plugin-json": "~4.1.0",
"@rollup/plugin-node-resolve": "~13.1.3",
"@rollup/plugin-typescript": "~8.3.4",
"@types/jest": "~29.5.12",
"@types/stylis": "^4.0.2",
"eslint": "~8.38.0",
"eslint": "~8.45.0",
"jest": "~29.7.0",
"lint-all": "workspace:~",
"lint-all": "^0.31.25",
"prettier": "~2.8.7",
"rollup": "~2.79.2",
"rollup-plugin-terser": "~7.0.2",
Expand All @@ -60,9 +60,9 @@
},
"dependencies": {
"@emotion/hash": "^0.9.0",
"@rocket.chat/css-supports": "workspace:~",
"@rocket.chat/memo": "workspace:~",
"@rocket.chat/stylis-logical-props-middleware": "workspace:~",
"@rocket.chat/css-supports": "^0.31.25",
"@rocket.chat/memo": "^0.31.25",
"@rocket.chat/stylis-logical-props-middleware": "^0.31.25",
"stylis": "~4.3.2"
}
}
2 changes: 1 addition & 1 deletion packages/css-in-js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["dist", "node_modules", "src/*.spec.ts"]
"exclude": ["dist", "node_modules"]
}
10 changes: 5 additions & 5 deletions packages/css-supports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
"docs": "typedoc"
},
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"eslint": "~8.38.0",
"lint-all": "workspace:~",
"@rocket.chat/eslint-config-alt": "^0.31.25",
"@rocket.chat/prettier-config": "^0.31.25",
"eslint": "~8.45.0",
"lint-all": "^0.31.25",
"prettier": "~2.8.7",
"rimraf": "~3.0.2",
"typedoc": "~0.25.13",
"typescript": "~5.6.3"
},
"dependencies": {
"@rocket.chat/memo": "workspace:~"
"@rocket.chat/memo": "^0.31.25"
},
"eslintConfig": {
"extends": "@rocket.chat/eslint-config-alt/typescript"
Expand Down
8 changes: 4 additions & 4 deletions packages/emitter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
"docs": "typedoc"
},
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"@rocket.chat/eslint-config-alt": "^0.31.25",
"@rocket.chat/prettier-config": "^0.31.25",
"@rollup/plugin-commonjs": "~21.0.3",
"@rollup/plugin-json": "~4.1.0",
"@rollup/plugin-node-resolve": "~13.1.3",
"@rollup/plugin-typescript": "~8.3.4",
"@types/jest": "~29.5.12",
"eslint": "~8.38.0",
"eslint": "~8.45.0",
"jest": "~29.7.0",
"lint-all": "workspace:~",
"lint-all": "^0.31.25",
"npm-run-all": "^4.1.5",
"prettier": "~2.8.7",
"rollup": "~2.79.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config-alt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
},
"devDependencies": {
"@babel/eslint-parser": "~7.21.3",
"eslint": "~8.38.0",
"lint-all": "workspace:~",
"eslint": "~8.45.0",
"lint-all": "^0.31.25",
"prettier": "~2.8.7"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "~5.58.0",
"@typescript-eslint/parser": "~5.58.0",
"@typescript-eslint/eslint-plugin": "~8.8.1",
"@typescript-eslint/parser": "~8.8.1",
"eslint-config-prettier": "~8.8.0",
"eslint-import-resolver-typescript": "~3.5.5",
"eslint-plugin-import": "~2.26.0",
Expand Down
87 changes: 27 additions & 60 deletions packages/eslint-config-alt/typescript/index.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,38 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'../minimal',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-var-requires': 'off',
'func-call-spacing': 'off',
'indent': 'off',
'import/order': [
'error',
{
'newlines-between': 'always',
'groups': [
'builtin',
'external',
'internal',
['parent', 'sibling', 'index'],
],
'alphabetize': {
order: 'asc',
},
},
],
'no-empty-function': 'off',
'no-extra-parens': 'off',
'no-redeclare': 'off',
'no-spaced-func': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'no-useless-constructor': 'off',
'no-use-before-define': 'off',
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'prettier/prettier': 'error',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {},
},
},
overrides: [
{
files: ['*.+(ts|tsx|cts|ctsx|mts|mtsx)'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
rules: {
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'no-dupe-class-members': 'off',
'no-empty-function': 'off',
'no-use-before-define': 'off',
'no-useless-constructor': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {},
},
},
},
],
Expand Down
12 changes: 6 additions & 6 deletions packages/fuselage-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"test": "jest --runInBand"
},
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:~",
"@rocket.chat/fuselage-tokens": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"@rocket.chat/eslint-config-alt": "^0.31.25",
"@rocket.chat/fuselage-tokens": "^0.33.1",
"@rocket.chat/prettier-config": "^0.31.25",
"@rollup/plugin-commonjs": "~21.0.3",
"@rollup/plugin-json": "~4.1.0",
"@rollup/plugin-node-resolve": "~13.1.3",
Expand All @@ -56,16 +56,16 @@
"@types/react-dom": "~17.0.25",
"@types/resize-observer-browser": "~0.1.7",
"@types/use-sync-external-store": "~0.0.3",
"eslint": "~8.38.0",
"eslint": "~8.45.0",
"jest": "~29.7.0",
"lint-all": "workspace:~",
"lint-all": "^0.31.25",
"npm-run-all": "^4.1.5",
"prettier": "~2.8.7",
"react": "^17.0.2",
"rimraf": "~5.0.0",
"rollup": "~2.79.2",
"rollup-plugin-terser": "~7.0.2",
"testing-utils": "workspace:~",
"testing-utils": "^0.31.25",
"ts-jest": "~29.2.4",
"typedoc": "~0.25.13",
"typescript": "~5.6.3"
Expand Down
8 changes: 4 additions & 4 deletions packages/fuselage-polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"new-event-polyfill": "^1.0.1"
},
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"eslint": "~8.38.0",
"lint-all": "workspace:~",
"@rocket.chat/eslint-config-alt": "^0.31.25",
"@rocket.chat/prettier-config": "^0.31.25",
"eslint": "~8.45.0",
"lint-all": "^0.31.25",
"prettier": "~2.8.7"
}
}
18 changes: 9 additions & 9 deletions packages/fuselage-toastbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"build-storybook": "storybook build"
},
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:~",
"@rocket.chat/fuselage": "workspace:~",
"@rocket.chat/fuselage-hooks": "workspace:~",
"@rocket.chat/fuselage-tokens": "workspace:~",
"@rocket.chat/layout": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"@rocket.chat/styled": "workspace:~",
"@rocket.chat/eslint-config-alt": "^0.31.25",
"@rocket.chat/fuselage": "^0.59.2",
"@rocket.chat/fuselage-hooks": "^0.33.1",
"@rocket.chat/fuselage-tokens": "^0.33.1",
"@rocket.chat/layout": "^0.31.27",
"@rocket.chat/prettier-config": "^0.31.25",
"@rocket.chat/styled": "^0.31.25",
"@storybook/addon-essentials": "~8.2.7",
"@storybook/addon-webpack5-compiler-swc": "~1.0.5",
"@storybook/react": "~8.2.7",
Expand All @@ -63,10 +63,10 @@
"@types/jest": "~29.5.12",
"@types/react": "~17.0.80",
"@types/react-dom": "~17.0.25",
"eslint": "~8.38.0",
"eslint": "~8.45.0",
"jest": "~29.7.0",
"jest-environment-jsdom": "~29.7.0",
"lint-all": "workspace:~",
"lint-all": "^0.31.25",
"npm-run-all": "^4.1.5",
"prettier": "~2.8.7",
"react-dom": "~17.0.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/fuselage-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
".:build:clean": "rimraf dist"
},
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:~",
"@rocket.chat/prettier-config": "workspace:~",
"build-design-tokens": "workspace:~",
"eslint": "~8.38.0",
"@rocket.chat/eslint-config-alt": "^0.31.25",
"@rocket.chat/prettier-config": "^0.31.25",
"build-design-tokens": "^0.31.25",
"eslint": "~8.45.0",
"eslint-config-prettier": "~8.8.0",
"eslint-plugin-import": "~2.26.0",
"eslint-plugin-prettier": "~4.2.1",
"lint-all": "workspace:~",
"lint-all": "^0.31.25",
"npm-run-all": "^4.1.5",
"postcss-scss": "~4.0.6",
"prettier": "~2.8.7",
Expand Down
25 changes: 0 additions & 25 deletions packages/fuselage/.eslintrc.js

This file was deleted.

25 changes: 25 additions & 0 deletions packages/fuselage/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": [
"@rocket.chat/eslint-config-alt/typescript",
"@rocket.chat/eslint-config-alt/react"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-use-before-define": "off",
"react/display-name": "off",
"react/no-multi-comp": "off"
},
"env": {
"jest": true
},
"overrides": [
{
"files": ["*.mdx"],
"extends": ["plugin:mdx/recommended"],
"rules": {
"react/self-closing-comp": "off"
}
}
]
}
Loading

0 comments on commit 07c4055

Please sign in to comment.