diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..e833455 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "root": true, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "plugins": [ + "@typescript-eslint", + "react" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 8, + "sourceType": "module" + }, + "rules": { + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-inferrable-types": 0, + "@typescript-eslint/no-namespace": 0, + "@typescript-eslint/ban-ts-comment": 0, + "@typescript-eslint/no-var-requires": 0 + } +} diff --git a/.github/workflows/frontend-analysis.yml b/.github/workflows/frontend-analysis.yml index b71d834..852b3a5 100644 --- a/.github/workflows/frontend-analysis.yml +++ b/.github/workflows/frontend-analysis.yml @@ -33,7 +33,7 @@ jobs: run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress" - name: "yarn install" - uses: "borales/actions-yarn@v2.0.0" + uses: "borales/actions-yarn@v3.0.0" with: cmd: "install" @@ -41,7 +41,7 @@ jobs: run: "yarn ts-unused-exports tsconfig.json $(find src/Resources/public -name '*.ts*') --showLineNumber" - name: "Typescript linting" - run: "yarn tslint src/Resources/public/**/*.ts src/Resources/public/**/*.tsx src/Resources/public/**/**/*.tsx" + run: "yarn eslint src/Resources/public/**/*.ts src/Resources/public/**/*.tsx src/Resources/public/**/**/*.tsx" - name: "Coding Style" run: "yarn prettier --config .prettierrc.json --check src/Resources/public/**/*.ts src/Resources/public/**/*.tsx jest/**/*.ts jest/**/*.tsx" diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index aeec3f9..4e666cc 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -35,7 +35,7 @@ jobs: run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress" - name: "yarn install" - uses: "borales/actions-yarn@v2.0.0" + uses: "borales/actions-yarn@v3.0.0" with: cmd: "install" diff --git a/composer.json b/composer.json index 512adf9..a1fb7aa 100644 --- a/composer.json +++ b/composer.json @@ -30,5 +30,10 @@ "symfony/debug-bundle": "^4.4", "symfony/web-profiler-bundle": "^4.4", "symfony/web-server-bundle": "^4.4" + }, + "config": { + "allow-plugins": { + "symfony/flex": true + } } } diff --git a/package.json b/package.json index 0f5abf5..ff42a53 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,11 @@ "vendor/akeneo/pim-enterprise-dev/src/Akeneo/Pim/Automation/DataQualityInsights/front" ], "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.42.0", + "@typescript-eslint/parser": "^5.42.0", + "eslint": "^8.26.0", + "eslint-plugin-react": "^7.31.10", "prettier": "^2.1.1", - "ts-unused-exports": "^6.2.3", - "tslint": "^6.1.3" + "ts-unused-exports": "^6.2.3" } } diff --git a/src/Resources/public/reference-entity/attribute/table/reducer.ts b/src/Resources/public/reference-entity/attribute/table/reducer.ts index 0c7b069..4746bd7 100644 --- a/src/Resources/public/reference-entity/attribute/table/reducer.ts +++ b/src/Resources/public/reference-entity/attribute/table/reducer.ts @@ -7,8 +7,7 @@ const tableAttributeReducer = ( ): NormalizedTableAttribute => { switch (propertyCode) { case 'table_property': - const tableProperty = propertyValue as NormalizedTableProperty; - return { ...normalizedAttribute, table_property: tableProperty }; + return { ...normalizedAttribute, table_property: propertyValue as NormalizedTableProperty }; default: break; diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 42419e2..0000000 --- a/tslint.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "max-classes-per-file": false, - "no-namespace": false, - "object-literal-shorthand": [true, "never"], - "variable-name": { - "options": [ - "allow-snake-case" - ] - }, - "no-shadowed-variable": [ - true, - { - "temporalDeadZone": false - } - ] - }, - "rulesDirectory": [] -}