diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index d7b2dc8..233ba94 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -56,9 +56,6 @@ "files": [ "dist" ], - "scripts": { - "build": "tsc -p ./tsconfig.build.json" - }, "dependencies": { "@emotion/eslint-plugin": "^11.11.0", "@nx/eslint-plugin": "^16.5.0", diff --git a/packages/eslint-config/project.json b/packages/eslint-config/project.json index 5892eb0..5398367 100644 --- a/packages/eslint-config/project.json +++ b/packages/eslint-config/project.json @@ -4,6 +4,26 @@ "sourceRoot": "packages/eslint-config/src", "projectType": "library", "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "tsc -p packages/eslint-config/tsconfig.build.json" + } + }, + "test": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "dependsOn": ["build"], + "options": { + "noEslintrc": true, + "eslintConfig": "packages/eslint-config/tests/.eslintrc.cjs", + "reportUnusedDisableDirectives": "error", + "lintFilePatterns": [ + "packages/eslint-config/tests/**/*.ts", + "packages/eslint-config/tests/**/*.tsx" + ] + } + }, "quality": { "executor": "@tablecheck/nx:quality", "outputs": ["{options.outputFile}"], diff --git a/packages/eslint-config/src/presets/typescript.ts b/packages/eslint-config/src/presets/typescript.ts index 6e47a10..6910c8e 100644 --- a/packages/eslint-config/src/presets/typescript.ts +++ b/packages/eslint-config/src/presets/typescript.ts @@ -22,6 +22,7 @@ module.exports = { ...promiseRules, ...emotionRules, ...namingRules, + 'no-unused-vars': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', }, }), @@ -30,7 +31,6 @@ module.exports = { rules: { 'import/no-default-export': 'off', 'vars-on-top': 'off', - 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-empty-interface': 'warn', '@typescript-eslint/explicit-module-boundary-types': 'off', diff --git a/packages/eslint-config/src/rules/namingConvention.ts b/packages/eslint-config/src/rules/namingConvention.ts index 596c0e9..4c9dd01 100644 --- a/packages/eslint-config/src/rules/namingConvention.ts +++ b/packages/eslint-config/src/rules/namingConvention.ts @@ -1,16 +1,18 @@ import type { Linter } from 'eslint'; +const componentRegexpMatch = { + regex: '(?