diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 61b8bda45e..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "root": true, - "ignorePatterns": ["**/*"], - "plugins": ["@nx"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "@nx/enforce-module-boundaries": [ - "error", - { - "allow": [], - "depConstraints": [ - { - "sourceTag": "*", - "onlyDependOnLibsWithTags": ["*"] - } - ] - } - ], - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-inferrable-types": "warn" - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@nx/typescript"], - "rules": { - "no-extra-semi": "off" - } - }, - { - "files": ["*.js", "*.jsx"], - "extends": ["plugin:@nx/javascript"], - "rules": { - "no-extra-semi": "off" - } - }, - { - "files": ["*.ts"], - "rules": { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "argsIgnorePattern": "^_", - "varsIgnorePattern": "^_", - "caughtErrorsIgnorePattern": "^_" - } - ], - "@typescript-eslint/naming-convention": "off", - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/no-empty-function": "warn", - "@typescript-eslint/no-empty-object-type": "warn", - "eqeqeq": ["off", "smart"], - "id-blacklist": [ - "error", - "any", - "Number", - "number", - "String", - "string", - "Boolean", - "boolean", - "Undefined", - "undefined" - ], - "id-match": "error", - "no-eval": "off", - "no-redeclare": "off", - "no-underscore-dangle": "off", - "no-var": "error", - "no-prototype-builtins": "off", - "@typescript-eslint/no-wrapper-object-types": "off", - "@typescript-eslint/no-unsafe-function-type": "off" - }, - "plugins": ["eslint-plugin-import", "@typescript-eslint"] - }, - { - "files": ["*.html"], - "rules": {} - } - ] -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..936417b846 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,110 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import nxEslintPlugin from '@nx/eslint-plugin'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist'], + }, + { plugins: { '@nx': nxEslintPlugin } }, + { + files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], + rules: { + '@nx/enforce-module-boundaries': [ + 'error', + { + allow: [], + depConstraints: [ + { + sourceTag: '*', + onlyDependOnLibsWithTags: ['*'], + }, + ], + }, + ], + '@typescript-eslint/member-ordering': 'off', + '@typescript-eslint/no-inferrable-types': 'warn', + }, + }, + ...compat + .config({ + extends: ['plugin:@nx/typescript'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'], + rules: { + ...config.rules, + 'no-extra-semi': 'off', + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/javascript'], + }) + .map((config) => ({ + ...config, + files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'], + rules: { + ...config.rules, + 'no-extra-semi': 'off', + }, + })), + ...compat + .config({ + plugins: ['eslint-plugin-import', '@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], + '@typescript-eslint/naming-convention': 'off', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/no-empty-function': 'warn', + '@typescript-eslint/no-empty-object-type': 'warn', + eqeqeq: ['off', 'smart'], + 'id-blacklist': [ + 'error', + 'any', + 'Number', + 'number', + 'String', + 'string', + 'Boolean', + 'boolean', + 'Undefined', + 'undefined', + ], + 'id-match': 'error', + 'no-eval': 'off', + 'no-redeclare': 'off', + 'no-underscore-dangle': 'off', + 'no-var': 'error', + 'no-prototype-builtins': 'off', + '@typescript-eslint/no-wrapper-object-types': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + }, + })), + { + files: ['**/*.html'], + // Override or add rules here + rules: {}, + }, +]; diff --git a/modules/component-store/.eslintrc.json b/modules/component-store/.eslintrc.json deleted file mode 100644 index 572e63364d..0000000000 --- a/modules/component-store/.eslintrc.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/component-store/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/component-store/eslint.config.mjs b/modules/component-store/eslint.config.mjs new file mode 100644 index 0000000000..ca07afda5f --- /dev/null +++ b/modules/component-store/eslint.config.mjs @@ -0,0 +1,54 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist', '**/jest.config.ts', '**/schematics-core/test-setup.ts', '**/schematics-core/utility/standalone.ts'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/component-store/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/component-store/project.json b/modules/component-store/project.json index 02b4b56f09..46d998edfd 100644 --- a/modules/component-store/project.json +++ b/modules/component-store/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/component-store/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -49,7 +51,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/component-store"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/component/.eslintrc.json b/modules/component/.eslintrc.json deleted file mode 100644 index 99c25a5d03..0000000000 --- a/modules/component/.eslintrc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/component/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@angular-eslint/no-input-rename": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/component/eslint.config.mjs b/modules/component/eslint.config.mjs new file mode 100644 index 0000000000..baeedcddef --- /dev/null +++ b/modules/component/eslint.config.mjs @@ -0,0 +1,55 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist', '**/jest.config.ts', '**/schematics-core/test-setup.ts', '**/schematics-core/utility/standalone.ts'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@angular-eslint/no-input-rename': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/component/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/component/project.json b/modules/component/project.json index 0505194987..dd07a81061 100644 --- a/modules/component/project.json +++ b/modules/component/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/component/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -49,7 +51,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/component"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/data/.eslintrc.json b/modules/data/.eslintrc.json deleted file mode 100644 index 96d8b04e33..0000000000 --- a/modules/data/.eslintrc.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/data/tsconfig.*?.json"] - }, - "rules": { - "@typescript-eslint/no-non-null-assertion": "off", - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "no-case-declarations": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/data/eslint.config.mjs b/modules/data/eslint.config.mjs new file mode 100644 index 0000000000..af2cec910d --- /dev/null +++ b/modules/data/eslint.config.mjs @@ -0,0 +1,56 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist', '**/jest.config.ts', '**/schematics-core/test-setup.ts'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@typescript-eslint/no-non-null-assertion': 'off', + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + 'no-case-declarations': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/data/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/data/project.json b/modules/data/project.json index d33d4d0850..2ff0e37ebe 100644 --- a/modules/data/project.json +++ b/modules/data/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/data/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -49,7 +51,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/data"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/effects/.eslintrc.json b/modules/effects/.eslintrc.json deleted file mode 100644 index 06fd2a60f1..0000000000 --- a/modules/effects/.eslintrc.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/effects/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["testing/**/*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/effects/testing/tsconfig.*?.json"] - }, - "rules": { - "@nx/enforce-module-boundaries": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/effects/eslint.config.mjs b/modules/effects/eslint.config.mjs new file mode 100644 index 0000000000..b02fe323cf --- /dev/null +++ b/modules/effects/eslint.config.mjs @@ -0,0 +1,80 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: [ + '**/dist', + '**/jest.config.ts', + '**/schematics-core/test-setup.ts', + ], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@angular-eslint/prefer-standalone': 'off', + '@nx/enforce-module-boundaries': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/effects/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['testing/**/*.ts'], + rules: { + ...config.rules, + '@nx/enforce-module-boundaries': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/effects/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/effects/project.json b/modules/effects/project.json index fe8551ff5b..410f0a6c48 100644 --- a/modules/effects/project.json +++ b/modules/effects/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/effects/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -61,7 +63,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/effects"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/entity/.eslintrc.json b/modules/entity/.eslintrc.json deleted file mode 100644 index f9b0395413..0000000000 --- a/modules/entity/.eslintrc.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/entity/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/entity/eslint.config.mjs b/modules/entity/eslint.config.mjs new file mode 100644 index 0000000000..738f8eed88 --- /dev/null +++ b/modules/entity/eslint.config.mjs @@ -0,0 +1,54 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist', '**/jest.config.ts', '**/schematics-core/test-setup.ts', '**/schematics-core/utility/standalone.ts'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/entity/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/entity/project.json b/modules/entity/project.json index ff062da6d2..763966434d 100644 --- a/modules/entity/project.json +++ b/modules/entity/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/entity/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -61,7 +63,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/entity"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/eslint-plugin/.eslintrc.json b/modules/eslint-plugin/.eslintrc.json deleted file mode 100644 index 052a5874e6..0000000000 --- a/modules/eslint-plugin/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"] -} diff --git a/modules/eslint-plugin/eslint.config.mjs b/modules/eslint-plugin/eslint.config.mjs new file mode 100644 index 0000000000..69686f6436 --- /dev/null +++ b/modules/eslint-plugin/eslint.config.mjs @@ -0,0 +1,8 @@ +import baseConfig from '../../eslint.config.mjs'; + +export default [ + { + ignores: ['**/dist'], + }, + ...baseConfig, +]; diff --git a/modules/eslint-plugin/project.json b/modules/eslint-plugin/project.json index f2b6fb354d..e3dd9987d6 100644 --- a/modules/eslint-plugin/project.json +++ b/modules/eslint-plugin/project.json @@ -3,6 +3,7 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "modules/eslint-plugin/src", + "tags": [], "targets": { "build-package": { "executor": "@nx/js:tsc", @@ -71,6 +72,5 @@ }, "outputs": ["{options.outputFile}"] } - }, - "tags": [] + } } diff --git a/modules/operators/.eslintrc.json b/modules/operators/.eslintrc.json deleted file mode 100644 index 49070f0862..0000000000 --- a/modules/operators/.eslintrc.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/operators/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/operators/eslint.config.mjs b/modules/operators/eslint.config.mjs new file mode 100644 index 0000000000..341921be4c --- /dev/null +++ b/modules/operators/eslint.config.mjs @@ -0,0 +1,53 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/operators/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/operators/project.json b/modules/operators/project.json index b303bb0512..9fa95323fd 100644 --- a/modules/operators/project.json +++ b/modules/operators/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/operators/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -49,7 +51,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/operators"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/router-store/.eslintrc.json b/modules/router-store/.eslintrc.json deleted file mode 100644 index 00c130ca82..0000000000 --- a/modules/router-store/.eslintrc.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": [ - "!**/*", - "schematics-core", - "data-persistence/src/public_api.ts", - "data-persistence/src/operators.ts", - "data-persistence/index.ts" - ], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/router-store/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/router-store/eslint.config.mjs b/modules/router-store/eslint.config.mjs new file mode 100644 index 0000000000..d34710bdc6 --- /dev/null +++ b/modules/router-store/eslint.config.mjs @@ -0,0 +1,66 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: [ + '**/dist', + '**/router-store/data-persistence/index.ts', + '**/router-store/data-persistence/src/operators.ts', + '**/router-store/data-persistence/src/public_api.ts', + '**/router-store/schematics-core/jest.config.ts', + '**/router-store/schematics-core/test-setup.ts' + ], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/router-store/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: [ + 'schematics-core', + 'data-persistence/src/public_api.ts', + 'data-persistence/src/operators.ts', + 'data-persistence/index.ts', + ], + }, +]; diff --git a/modules/router-store/project.json b/modules/router-store/project.json index 6188c6fd64..83a992e9a4 100644 --- a/modules/router-store/project.json +++ b/modules/router-store/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/router-store/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -49,7 +51,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/router-store"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/schematics-core/.eslintrc.json b/modules/schematics-core/.eslintrc.json deleted file mode 100644 index f51a445bf1..0000000000 --- a/modules/schematics-core/.eslintrc.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/schematics-core/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "no-prototype-builtins": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/schematics-core/eslint.config.mjs b/modules/schematics-core/eslint.config.mjs new file mode 100644 index 0000000000..f8fe15a640 --- /dev/null +++ b/modules/schematics-core/eslint.config.mjs @@ -0,0 +1,51 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + 'no-prototype-builtins': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/schematics-core/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), +]; diff --git a/modules/schematics-core/project.json b/modules/schematics-core/project.json index 5e2b91d9e1..c5f071a0cf 100644 --- a/modules/schematics-core/project.json +++ b/modules/schematics-core/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/schematics-core", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "lint": { "executor": "@nx/eslint:lint", @@ -22,7 +24,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/schematics-core"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/modules/schematics/.eslintrc.json b/modules/schematics/.eslintrc.json deleted file mode 100644 index d8f150fac7..0000000000 --- a/modules/schematics/.eslintrc.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/schematics/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/schematics/eslint.config.mjs b/modules/schematics/eslint.config.mjs new file mode 100644 index 0000000000..4e9ca6624a --- /dev/null +++ b/modules/schematics/eslint.config.mjs @@ -0,0 +1,53 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/schematics/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/schematics/project.json b/modules/schematics/project.json index 67be311edc..4790a3f45d 100644 --- a/modules/schematics/project.json +++ b/modules/schematics/project.json @@ -3,6 +3,7 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "modules/schematics/src", "projectType": "library", + "tags": [], "generators": {}, "targets": { "lint": { @@ -83,6 +84,5 @@ }, "outputs": ["{workspaceRoot}/dist/modules/schematics"] } - }, - "tags": [] + } } diff --git a/modules/signals/.eslintrc.json b/modules/signals/.eslintrc.json deleted file mode 100644 index 8487095ac2..0000000000 --- a/modules/signals/.eslintrc.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": [ - "!**/*", - "schematics-core", - "**/vite.config.*.timestamp*", - "**/vitest.config.*.timestamp*" - ], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/signals/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@nx/enforce-module-boundaries": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/signals/eslint.config.mjs b/modules/signals/eslint.config.mjs new file mode 100644 index 0000000000..424ba60c55 --- /dev/null +++ b/modules/signals/eslint.config.mjs @@ -0,0 +1,59 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@nx/enforce-module-boundaries': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/signals/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: [ + 'schematics-core', + '**/vite.config.*.timestamp*', + '**/vitest.config.*.timestamp*', + ], + }, +]; diff --git a/modules/store-devtools/.eslintrc.json b/modules/store-devtools/.eslintrc.json deleted file mode 100644 index 87b7d95b0b..0000000000 --- a/modules/store-devtools/.eslintrc.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/store-devtools/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/store-devtools/eslint.config.mjs b/modules/store-devtools/eslint.config.mjs new file mode 100644 index 0000000000..e1ee6266dd --- /dev/null +++ b/modules/store-devtools/eslint.config.mjs @@ -0,0 +1,54 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist', '**/jest.config.ts', '**/schematics-core/test-setup.ts'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/store-devtools/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/store-devtools/project.json b/modules/store-devtools/project.json index f7d55c93fb..b57848b9a7 100644 --- a/modules/store-devtools/project.json +++ b/modules/store-devtools/project.json @@ -4,6 +4,15 @@ "projectType": "library", "sourceRoot": "modules/store-devtools/src", "prefix": "ngrx", + "tags": [], + "generators": { + "@angular-eslint/schematics:application": { + "setParserOptionsProject": true + }, + "@angular-eslint/schematics:library": { + "setParserOptionsProject": true + } + }, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -49,14 +58,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/store-devtools"] } - }, - "generators": { - "@angular-eslint/schematics:application": { - "setParserOptionsProject": true - }, - "@angular-eslint/schematics:library": { - "setParserOptionsProject": true - } - }, - "tags": [] + } } diff --git a/modules/store/.eslintrc.json b/modules/store/.eslintrc.json deleted file mode 100644 index 5afb708cd6..0000000000 --- a/modules/store/.eslintrc.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/store/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": "off", - "@angular-eslint/component-selector": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["testing/**/*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["modules/store/testing/tsconfig.*?.json"] - }, - "rules": { - "@nx/enforce-module-boundaries": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/modules/store/eslint.config.mjs b/modules/store/eslint.config.mjs new file mode 100644 index 0000000000..8298da0852 --- /dev/null +++ b/modules/store/eslint.config.mjs @@ -0,0 +1,80 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: [ + '**/dist', + '**/jest.config.ts', + '**/schematics-core/test-setup.ts', + ], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': 'off', + '@angular-eslint/component-selector': 'off', + '@angular-eslint/prefer-standalone': 'off', + '@nx/enforce-module-boundaries': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/store/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['testing/**/*.ts'], + rules: { + ...config.rules, + '@nx/enforce-module-boundaries': 'off', + }, + languageOptions: { + parserOptions: { + project: ['modules/store/testing/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['schematics-core'], + }, +]; diff --git a/modules/store/project.json b/modules/store/project.json index 7664a1b7af..6d52c9abf6 100644 --- a/modules/store/project.json +++ b/modules/store/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "modules/store/src", "prefix": "ngrx", + "tags": [], + "generators": {}, "targets": { "build-package": { "executor": "@angular-devkit/build-angular:ng-packagr", @@ -61,7 +63,5 @@ }, "outputs": ["{workspaceRoot}/coverage/modules/store"] } - }, - "generators": {}, - "tags": [] + } } diff --git a/nx.json b/nx.json index 19bf23e8ba..f88b6244b7 100644 --- a/nx.json +++ b/nx.json @@ -58,7 +58,7 @@ "cache": true }, "lint": { - "inputs": ["default", "{workspaceRoot}/.eslintrc.json"], + "inputs": ["default", "{workspaceRoot}/eslint.config.mjs"], "cache": true }, "build-package": { @@ -91,8 +91,8 @@ "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s", - "!{projectRoot}/.eslintrc.json", - "!{projectRoot}/src/test-setup.[jt]s" + "!{projectRoot}/src/test-setup.[jt]s", + "!{projectRoot}/eslint.config.mjs" ] }, "nxCloudAccessToken": "NTlmOGIxYmItZjM0OC00YzAxLTgzZTgtZDNiZmExMzcwZTA4fHJlYWQ=", diff --git a/package.json b/package.json index c64d18fb18..12e53d0601 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "update:check": "ng update", "update:versions": "ts-node ./build/update-version-numbers.ts", "postupdate:versions": "npm run changelog", - "lint": "nx workspace-lint && ng lint", + "lint": "nx run-many --target=lint --all", "eslint-plugin:update": "ts-node ./build/generate-eslint-plugin.ts", "prepare": "husky install" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 631eb6e70a..fdc9515c95 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26926,4 +26926,4 @@ snapshots: zod@3.25.76: {} - zone.js@0.15.0: {} + zone.js@0.15.0: {} \ No newline at end of file diff --git a/projects/example-app-e2e/.eslintrc.json b/projects/example-app-e2e/.eslintrc.json deleted file mode 100644 index 8575d60aa6..0000000000 --- a/projects/example-app-e2e/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "parserOptions": { - "project": "projects/example-app-e2e/tsconfig.*?.json" - }, - "rules": {} - }, - { - "files": ["src/plugins/index.js"], - "rules": { - "@typescript-eslint/no-var-requires": "off", - "no-undef": "off" - } - } - ], - "plugins": ["@typescript-eslint"], - "rules": {} -} diff --git a/projects/example-app-e2e/eslint.config.mjs b/projects/example-app-e2e/eslint.config.mjs new file mode 100644 index 0000000000..449b4e08e6 --- /dev/null +++ b/projects/example-app-e2e/eslint.config.mjs @@ -0,0 +1,110 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist', '**/environment.prod.ts'], + }, + ...baseConfig, + + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'bc', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'bc', + style: 'kebab-case', + }, + ], + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@nx/enforce-module-boundaries': 'off', + eqeqeq: ['off', 'smart'], + 'id-blacklist': [ + 'error', + 'any', + 'Number', + 'number', + 'String', + 'string', + 'Boolean', + 'boolean', + 'Undefined', + 'undefined', + ], + 'id-match': 'error', + 'no-eval': 'off', + 'no-redeclare': 'error', + 'no-underscore-dangle': 'error', + 'no-var': 'error', + 'no-case-declarations': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['projects/example-app-e2e/tsconfig.*.json'], + }, + }, + })), + + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + files: ['src/**/*.cy.{ts,tsx}'], + languageOptions: { + parserOptions: { + project: ['projects/example-app-e2e/tsconfig.*.json'], + }, + globals: { + cy: true, + describe: true, + it: true, + before: true, + beforeEach: true, + after: true, + afterEach: true, + }, + }, + rules: { + // Add optional Cypress-safe tweaks + 'no-unused-expressions': 'off', // Allow Chai-style assertions + '@typescript-eslint/no-floating-promises': 'off', // Often triggered by cy.* commands + }, + }, +]; diff --git a/projects/example-app-e2e/project.json b/projects/example-app-e2e/project.json index cdb317c174..24780e14b3 100644 --- a/projects/example-app-e2e/project.json +++ b/projects/example-app-e2e/project.json @@ -3,6 +3,8 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "projects/example-app-e2e/src", "projectType": "application", + "tags": [], + "implicitDependencies": ["example-app"], "targets": { "e2e": { "executor": "@nx/cypress:cypress", @@ -27,7 +29,5 @@ }, "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["example-app"] + } } diff --git a/projects/example-app/.eslintrc.json b/projects/example-app/.eslintrc.json deleted file mode 100644 index 4c0aa0c0bd..0000000000 --- a/projects/example-app/.eslintrc.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "**/environment.prod.ts"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["projects/example-app/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": "bc", - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "bc", - "style": "kebab-case" - } - ], - "@typescript-eslint/prefer-namespace-keyword": "error", - "@nx/enforce-module-boundaries": "off", - "eqeqeq": ["off", "smart"], - "id-blacklist": [ - "error", - "any", - "Number", - "number", - "String", - "string", - "Boolean", - "boolean", - "Undefined", - "undefined" - ], - "id-match": "error", - "no-eval": "off", - "no-redeclare": "error", - "no-underscore-dangle": "error", - "no-var": "error", - "no-case-declarations": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/projects/example-app/eslint.config.mjs b/projects/example-app/eslint.config.mjs new file mode 100644 index 0000000000..214ee22b53 --- /dev/null +++ b/projects/example-app/eslint.config.mjs @@ -0,0 +1,89 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import js from '@eslint/js'; +import baseConfig from '../../eslint.config.mjs'; + +const compat = new FlatCompat({ + baseDirectory: dirname(fileURLToPath(import.meta.url)), + recommendedConfig: js.configs.recommended, +}); + +export default [ + { + ignores: ['**/dist'], + }, + ...baseConfig, + ...compat + .config({ + extends: [ + 'plugin:@nx/angular', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + plugins: ['@typescript-eslint'], + }) + .map((config) => ({ + ...config, + files: ['**/*.ts'], + rules: { + ...config.rules, + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'bc', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'bc', + style: 'kebab-case', + }, + ], + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@nx/enforce-module-boundaries': 'off', + eqeqeq: ['off', 'smart'], + 'id-blacklist': [ + 'error', + 'any', + 'Number', + 'number', + 'String', + 'string', + 'Boolean', + 'boolean', + 'Undefined', + 'undefined', + ], + 'id-match': 'error', + 'no-eval': 'off', + 'no-redeclare': 'error', + 'no-underscore-dangle': 'error', + 'no-var': 'error', + 'no-case-declarations': 'off', + '@angular-eslint/prefer-standalone': 'off', + }, + languageOptions: { + parserOptions: { + project: ['projects/example-app/tsconfig.*.json'], + }, + }, + })), + ...compat + .config({ + extends: ['plugin:@nx/angular-template'], + }) + .map((config) => ({ + ...config, + files: ['**/*.html'], + rules: { + ...config.rules, + }, + })), + { + ignores: ['**/environment.prod.ts'], + }, +]; diff --git a/projects/ngrx.io/.eslintrc.json b/projects/ngrx.io/.eslintrc.json deleted file mode 100644 index de0a482819..0000000000 --- a/projects/ngrx.io/.eslintrc.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "schematics-core"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["projects/ngrx.io/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": ["aio", "ngrx"], - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": ["aio", "ngrx"], - "style": "kebab-case" - } - ], - "@angular-eslint/component-class-suffix": "error", - "@angular-eslint/directive-class-suffix": "error", - "@angular-eslint/no-input-rename": "off", - "@angular-eslint/no-output-rename": "off", - "@angular-eslint/no-output-on-prefix": "off", - "@angular-eslint/no-output-native": "off", - "@angular-eslint/use-pipe-transform-interface": "error", - "@typescript-eslint/consistent-type-definitions": "error", - "@typescript-eslint/dot-notation": "off", - "@typescript-eslint/explicit-member-accessibility": [ - "off", - { - "accessibility": "explicit" - } - ], - "@typescript-eslint/member-delimiter-style": [ - "off", - { - "multiline": { - "delimiter": "none", - "requireLast": true - }, - "singleline": { - "delimiter": "semi", - "requireLast": false - } - } - ], - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all" - } - ], - "@typescript-eslint/no-unused-expressions": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/semi": ["off", null], - "@typescript-eslint/unified-signatures": "error", - "@typescript-eslint/no-non-null-assertion": "off", - "brace-style": ["error", "1tbs"], - "curly": "error", - "eol-last": "error", - "eqeqeq": ["error", "smart"], - "guard-for-in": "error", - "id-blacklist": "off", - "id-match": "off", - "import/no-deprecated": "warn", - "max-len": [ - "error", - { - "code": 160 - } - ], - "no-bitwise": "error", - "no-caller": "error", - "no-console": [ - "error", - { - "allow": [ - "log", - "warn", - "dir", - "timeLog", - "assert", - "clear", - "count", - "countReset", - "group", - "groupEnd", - "table", - "dirxml", - "error", - "groupCollapsed", - "Console", - "profile", - "profileEnd", - "timeStamp", - "context" - ] - } - ], - "no-debugger": "error", - "no-empty": "off", - "no-eval": "error", - "no-fallthrough": "error", - "no-new-wrappers": "error", - "no-redeclare": "error", - "no-restricted-imports": "error", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-underscore-dangle": "off", - "no-unused-labels": "error", - "no-var": "error", - "prefer-const": "error", - "radix": "error", - "spaced-comment": [ - "error", - "always", - { - "markers": ["/"] - } - ], - "no-prototype-builtins": "off", - "@angular-eslint/prefer-standalone": "off" - }, - "plugins": [ - "eslint-plugin-import", - "@angular-eslint/eslint-plugin", - "@typescript-eslint" - ] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/projects/ngrx.io/content/examples/store/src/app/app.component.html b/projects/ngrx.io/content/examples/store/src/app/app.component.html index 1bdd5533a8..a9e25e616e 100644 --- a/projects/ngrx.io/content/examples/store/src/app/app.component.html +++ b/projects/ngrx.io/content/examples/store/src/app/app.component.html @@ -2,4 +2,4 @@