From dba6f93826161af34e5aa3eab4abd1c9386a4752 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Sun, 17 Sep 2023 08:41:46 -0700 Subject: [PATCH] Fix tests server --- .../tests/{all.spec.ts => effect-components.spec.ts} | 0 .../src/tests/matching-state-variable.spec.ts | 12 ++++++------ server/.eslintrc.js | 7 +------ server/package.json | 1 - server/yarn.lock | 3 --- 5 files changed, 7 insertions(+), 16 deletions(-) rename packages/eslint-plugin-twenty-ts/src/tests/{all.spec.ts => effect-components.spec.ts} (100%) diff --git a/packages/eslint-plugin-twenty-ts/src/tests/all.spec.ts b/packages/eslint-plugin-twenty-ts/src/tests/effect-components.spec.ts similarity index 100% rename from packages/eslint-plugin-twenty-ts/src/tests/all.spec.ts rename to packages/eslint-plugin-twenty-ts/src/tests/effect-components.spec.ts diff --git a/packages/eslint-plugin-twenty-ts/src/tests/matching-state-variable.spec.ts b/packages/eslint-plugin-twenty-ts/src/tests/matching-state-variable.spec.ts index 5a07b6cecf..f6bd2ce4ae 100644 --- a/packages/eslint-plugin-twenty-ts/src/tests/matching-state-variable.spec.ts +++ b/packages/eslint-plugin-twenty-ts/src/tests/matching-state-variable.spec.ts @@ -15,24 +15,24 @@ const ruleTester = new RuleTester({ ruleTester.run('matching-state-variable', matchingStateVariableRule, { valid: [ { - code: 'const myState = useRecoilValue(someAtom);', + code: 'const variable = useRecoilValue(variableState);', }, { - code: 'const [myState, setMyState] = useRecoilState(someAtom);', + code: 'const [variable, setVariable] = useRecoilState(variableState);', }, ], invalid: [ { - code: 'const myValue = useRecoilValue(someAtom);', + code: 'const myValue = useRecoilValue(variableState);', errors: [ { messageId: 'invalidVariableName', }, ], - output: 'const some = useRecoilValue(someAtom);', + output: 'const variable = useRecoilValue(variableState);', }, { - code: 'const [myValue, setMyValue] = useRecoilState(someAtom);', + code: 'const [myValue, setMyValue] = useRecoilState(variableState);', errors: [ { messageId: 'invalidVariableName', @@ -41,7 +41,7 @@ ruleTester.run('matching-state-variable', matchingStateVariableRule, { messageId: 'invalidSetterName', }, ], - output: 'const [some, setSome] = useRecoilState(someAtom);', + output: 'const [variable, setVariable] = useRecoilState(variableState);', }, ], }); diff --git a/server/.eslintrc.js b/server/.eslintrc.js index 9a4dd43c3f..6e43b58620 100644 --- a/server/.eslintrc.js +++ b/server/.eslintrc.js @@ -5,7 +5,7 @@ module.exports = { tsconfigRootDir : __dirname, sourceType: 'module', }, - plugins: ['@typescript-eslint/eslint-plugin', 'import', 'unused-imports','twenty-ts'], + plugins: ['@typescript-eslint/eslint-plugin', 'import', 'unused-imports'], extends: [ 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', @@ -17,11 +17,6 @@ module.exports = { }, ignorePatterns: ['.eslintrc.js', 'src/core/@generated/**'], rules: { - 'twenty-ts/effect-components': 'error', - 'twenty-ts/no-hardcoded-colors': 'error', - 'twenty-ts/matching-state-variable': 'error', - 'twenty-ts/sort-css-properties-alphabetically': 'error', - 'twenty-ts/styled-components-prefixed-with-styled': 'error', '@typescript-eslint/interface-name-prefix': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', diff --git a/server/package.json b/server/package.json index dd8c5f17cf..c84166df4d 100644 --- a/server/package.json +++ b/server/package.json @@ -108,7 +108,6 @@ "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-twenty-ts": "file:../packages/eslint-plugin-twenty-ts", "eslint-plugin-unused-imports": "^3.0.0", "jest": "28.1.3", "prettier": "^2.3.2", diff --git a/server/yarn.lock b/server/yarn.lock index 2cd4177841..a14ce170f2 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -4883,9 +4883,6 @@ eslint-plugin-prettier@^4.0.0: dependencies: prettier-linter-helpers "^1.0.0" -"eslint-plugin-twenty-ts@file:../packages/eslint-plugin-twenty-ts": - version "1.0.1" - eslint-plugin-unused-imports@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.0.0.tgz#d25175b0072ff16a91892c3aa72a09ca3a9e69e7"