diff --git a/packages/components-angular/.eslintrc.js b/packages/components-angular/.eslintrc.js new file mode 100644 index 0000000000..67a0956af2 --- /dev/null +++ b/packages/components-angular/.eslintrc.js @@ -0,0 +1,40 @@ +module.exports = { + root: true, + ignorePatterns: ['**/.eslintrc.js', 'dist', 'projects/**/*'], + overrides: [ + { + files: ['*.ts'], + parserOptions: { + project: ['tsconfig.json'], + createDefaultProgram: true, + }, + extends: [ + 'plugin:@angular-eslint/recommended', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'app', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'app', + style: 'kebab-case', + }, + ], + }, + }, + { + files: ['*.html'], + extends: ['plugin:@angular-eslint/template/recommended'], + rules: {}, + }, + ], +}; diff --git a/packages/components-angular/.eslintrc.json b/packages/components-angular/.eslintrc.json deleted file mode 100644 index d28d50ab5a..0000000000 --- a/packages/components-angular/.eslintrc.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "root": true, - "ignorePatterns": ["projects/**/*"], - "overrides": [ - { - "files": ["*.ts"], - "parserOptions": { - "project": ["tsconfig.json"], - "createDefaultProgram": true - }, - "extends": [ - "plugin:@angular-eslint/recommended", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": "app", - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "app", - "style": "kebab-case" - } - ] - } - }, - { - "files": ["*.html"], - "extends": ["plugin:@angular-eslint/template/recommended"], - "rules": {} - } - ] -} diff --git a/packages/components-angular/projects/components/.eslintrc.js b/packages/components-angular/projects/components/.eslintrc.js index afaa6d307f..309859a22f 100644 --- a/packages/components-angular/projects/components/.eslintrc.js +++ b/packages/components-angular/projects/components/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { - extends: '../../.eslintrc.json', - ignorePatterns: ['!**/*', 'node_modules'], + extends: '../../.eslintrc.js', + ignorePatterns: ['!**/*', 'src/lib/stencil-generated', 'node_modules'], overrides: [ { files: ['*.ts'], diff --git a/packages/components-react/.eslintignore b/packages/components-react/.eslintignore deleted file mode 100644 index 85249e592f..0000000000 --- a/packages/components-react/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -src/components/stencil-generated diff --git a/packages/components-react/.eslintrc.js b/packages/components-react/.eslintrc.js new file mode 100644 index 0000000000..586d17352a --- /dev/null +++ b/packages/components-react/.eslintrc.js @@ -0,0 +1,22 @@ +module.exports = { + env: { + es2021: true, + }, + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:@typescript-eslint/recommended', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + ignorePatterns: ['.eslintrc.js', 'dist', 'src/components/stencil-generated'], + plugins: ['react', '@typescript-eslint'], + settings: { + react: { + version: 'detect', + }, + }, +}; diff --git a/packages/components-react/.eslintrc.json b/packages/components-react/.eslintrc.json deleted file mode 100644 index 4a1c10433e..0000000000 --- a/packages/components-react/.eslintrc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "env": { - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:@typescript-eslint/recommended" - ], - "overrides": [ - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "react", - "@typescript-eslint" - ], - "settings": { - "react": { - "version": "detect" - } - }, - "rules": { - } -} diff --git a/packages/components-react/package.json b/packages/components-react/package.json index bfca1fae73..5ed8c556a7 100644 --- a/packages/components-react/package.json +++ b/packages/components-react/package.json @@ -16,7 +16,8 @@ "build": "pnpm run clean && pnpm run compile", "clean": "rimraf dist", "compile": "pnpm run tsc", - "tsc": "tsc -p ." + "tsc": "tsc -p .", + "lint": "eslint src/**/*.ts" }, "dependencies": { "@swisspost/design-system-components": "workspace:7.0.0" diff --git a/packages/components/.eslintignore b/packages/components/.eslintignore deleted file mode 100644 index fa6ee59bad..0000000000 --- a/packages/components/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -# place any directories created by the Stencil compilation process here -dist -loader -www -.stencil -cypress -stencil.config.ts -cypress.config.js -jest.config.js -.eslintrc.js diff --git a/packages/components/.eslintrc.js b/packages/components/.eslintrc.js index 6e6dd46738..2cc0b825e7 100644 --- a/packages/components/.eslintrc.js +++ b/packages/components/.eslintrc.js @@ -11,7 +11,16 @@ module.exports = { ], overrides: [], parser: '@typescript-eslint/parser', - ignorePatterns: ['.eslintrc.js'], + ignorePatterns: [ + '.eslintrc.js', + '.stencil', + 'cypress', + 'cypress.config.js', + 'dist', + 'loader', + 'stencil.config.ts', + 'www', + ], parserOptions: { ecmaVersion: 'latest', sourceType: 'module', diff --git a/packages/demo/.eslintignore b/packages/demo/.eslintignore deleted file mode 100644 index b59b85cf92..0000000000 --- a/packages/demo/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -.angular -dist diff --git a/packages/demo/.eslintrc.js b/packages/demo/.eslintrc.js index d3dd9318ce..8cdb7af815 100644 --- a/packages/demo/.eslintrc.js +++ b/packages/demo/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { root: true, - ignorePatterns: ['projects/**/*'], + ignorePatterns: ['.eslintrc.js', 'dist', '.angular'], overrides: [ { files: ['*.ts'], diff --git a/packages/internet-header/.eslintignore b/packages/internet-header/.eslintignore deleted file mode 100644 index f88a9adbbe..0000000000 --- a/packages/internet-header/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.stencil -loader -www -dist -node_modules -stencil.config.ts -cypress.config.js -jest.config.js -src/assets -.eslintrc.js diff --git a/packages/internet-header/.eslintrc.js b/packages/internet-header/.eslintrc.js index d3bba2e6fa..c79fc14825 100644 --- a/packages/internet-header/.eslintrc.js +++ b/packages/internet-header/.eslintrc.js @@ -1,5 +1,16 @@ module.exports = { extends: ['plugin:@stencil-community/recommended'], + ignorePatterns: [ + '.eslintrc.js', + '.stencil', + 'cypress', + 'cypress.config.js', + 'dist', + 'loader', + 'src/assets', + 'stencil.config.ts', + 'www', + ], parserOptions: { sourceType: 'module', ecmaVersion: 2020, diff --git a/packages/internet-header/package.json b/packages/internet-header/package.json index 4ae60b29ac..1166f11e83 100644 --- a/packages/internet-header/package.json +++ b/packages/internet-header/package.json @@ -69,6 +69,7 @@ "cypress": "13.7.2", "cypress-each": "1.14.0", "cypress-storybook": "0.5.1", + "eslint": "8.57.0", "eslint-plugin-react": "7.34.1", "globby": "14.0.1", "jest": "29.7.0", diff --git a/packages/internet-header/tsconfig.eslint.json b/packages/internet-header/tsconfig.eslint.json index 450adaefc1..13fc8ef9dc 100644 --- a/packages/internet-header/tsconfig.eslint.json +++ b/packages/internet-header/tsconfig.eslint.json @@ -1,5 +1,5 @@ { "extends": "./tsconfig.json", - "include": ["src", "**/tests", "cypress"], + "include": ["src", "**/tests"], "exclude": ["node_modules"] } diff --git a/packages/intranet-header-workspace/.eslintrc.js b/packages/intranet-header-workspace/.eslintrc.js new file mode 100644 index 0000000000..67a0956af2 --- /dev/null +++ b/packages/intranet-header-workspace/.eslintrc.js @@ -0,0 +1,40 @@ +module.exports = { + root: true, + ignorePatterns: ['**/.eslintrc.js', 'dist', 'projects/**/*'], + overrides: [ + { + files: ['*.ts'], + parserOptions: { + project: ['tsconfig.json'], + createDefaultProgram: true, + }, + extends: [ + 'plugin:@angular-eslint/recommended', + 'plugin:@angular-eslint/template/process-inline-templates', + ], + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'app', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'app', + style: 'kebab-case', + }, + ], + }, + }, + { + files: ['*.html'], + extends: ['plugin:@angular-eslint/template/recommended'], + rules: {}, + }, + ], +}; diff --git a/packages/intranet-header-workspace/.eslintrc.json b/packages/intranet-header-workspace/.eslintrc.json deleted file mode 100644 index 47c17dd9dd..0000000000 --- a/packages/intranet-header-workspace/.eslintrc.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "root": true, - "ignorePatterns": [ - "projects/**/*" - ], - "overrides": [ - { - "files": [ - "*.ts" - ], - "parserOptions": { - "project": [ - "tsconfig.json" - ], - "createDefaultProgram": true - }, - "extends": [ - "plugin:@angular-eslint/recommended", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": "app", - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "app", - "style": "kebab-case" - } - ] - } - }, - { - "files": [ - "*.html" - ], - "extends": [ - "plugin:@angular-eslint/template/recommended" - ], - "rules": {} - } - ] -} diff --git a/packages/intranet-header-workspace/projects/intranet-header-showcase/.eslintrc.js b/packages/intranet-header-workspace/projects/intranet-header-showcase/.eslintrc.js index f261644118..bc064dc2a5 100644 --- a/packages/intranet-header-workspace/projects/intranet-header-showcase/.eslintrc.js +++ b/packages/intranet-header-workspace/projects/intranet-header-showcase/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - extends: '../../.eslintrc.json', + extends: '../../.eslintrc.js', ignorePatterns: ['!**/*', 'node_modules'], overrides: [ { diff --git a/packages/intranet-header-workspace/projects/intranet-header/.eslintrc.js b/packages/intranet-header-workspace/projects/intranet-header/.eslintrc.js index e7eed4974d..8b08a2f50d 100644 --- a/packages/intranet-header-workspace/projects/intranet-header/.eslintrc.js +++ b/packages/intranet-header-workspace/projects/intranet-header/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - extends: '../../.eslintrc.json', + extends: '../../.eslintrc.js', ignorePatterns: ['!**/*', 'node_modules'], overrides: [ { diff --git a/packages/nextjs-integration/.eslintrc.js b/packages/nextjs-integration/.eslintrc.js new file mode 100644 index 0000000000..9451a58c4a --- /dev/null +++ b/packages/nextjs-integration/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + extends: 'next/core-web-vitals', + ignorePatterns: ['.eslintrc.js', 'next.config.js', 'postcss.config.js'], +}; diff --git a/packages/nextjs-integration/.eslintrc.json b/packages/nextjs-integration/.eslintrc.json deleted file mode 100644 index bffb357a71..0000000000 --- a/packages/nextjs-integration/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "next/core-web-vitals" -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59da3a58b2..0f2fa1f001 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -747,6 +747,9 @@ importers: cypress-storybook: specifier: 0.5.1 version: 0.5.1(cypress@13.7.2) + eslint: + specifier: 8.57.0 + version: 8.57.0 eslint-plugin-react: specifier: 7.34.1 version: 7.34.1(eslint@8.57.0) @@ -11344,7 +11347,7 @@ snapshots: undici: 6.7.1 vite: 5.1.5(@types/node@18.19.28)(less@4.2.0)(sass@1.71.1)(terser@5.29.1) watchpack: 2.4.0 - webpack: 5.90.3 + webpack: 5.90.3(esbuild@0.20.1) webpack-dev-middleware: 6.1.2(webpack@5.90.3(esbuild@0.20.1)) webpack-dev-server: 4.15.1(webpack@5.90.3(esbuild@0.20.1)) webpack-merge: 5.10.0 @@ -11438,7 +11441,7 @@ snapshots: undici: 6.7.1 vite: 5.1.5(@types/node@20.11.16)(less@4.2.0)(sass@1.71.1)(terser@5.29.1) watchpack: 2.4.0 - webpack: 5.90.3 + webpack: 5.90.3(esbuild@0.20.1) webpack-dev-middleware: 6.1.2(webpack@5.90.3(esbuild@0.20.1)) webpack-dev-server: 4.15.1(webpack@5.90.3(esbuild@0.20.1)) webpack-merge: 5.10.0 @@ -11475,7 +11478,7 @@ snapshots: '@angular-devkit/architect': 0.1703.3(chokidar@3.5.3) rxjs: 7.8.1 webpack: 5.90.3(esbuild@0.20.1) - webpack-dev-server: 4.15.1(webpack@5.91.0) + webpack-dev-server: 4.15.1(webpack@5.90.3(esbuild@0.20.1)) transitivePeerDependencies: - chokidar @@ -13587,7 +13590,7 @@ snapshots: debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 globals: 13.24.0 - ignore: 5.3.0 + ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -19578,7 +19581,7 @@ snapshots: dependencies: dir-glob: 3.0.1 fast-glob: 3.3.2 - ignore: 5.3.0 + ignore: 5.3.1 merge2: 1.4.1 slash: 4.0.0 @@ -24639,15 +24642,6 @@ snapshots: optionalDependencies: esbuild: 0.20.1 - terser-webpack-plugin@5.3.10(webpack@5.90.3(esbuild@0.20.1)): - dependencies: - '@jridgewell/trace-mapping': 0.3.22 - jest-worker: 27.5.1 - schema-utils: 3.3.0 - serialize-javascript: 6.0.1 - terser: 5.27.0 - webpack: 5.90.3 - terser-webpack-plugin@5.3.10(webpack@5.91.0): dependencies: '@jridgewell/trace-mapping': 0.3.22 @@ -24767,7 +24761,7 @@ snapshots: tr46@3.0.0: dependencies: - punycode: 2.3.0 + punycode: 2.3.1 tr46@5.0.0: dependencies: @@ -25512,6 +25506,15 @@ snapshots: webidl-conversions@7.0.0: {} + webpack-dev-middleware@5.3.3(webpack@5.90.3(esbuild@0.20.1)): + dependencies: + colorette: 2.0.20 + memfs: 3.5.1 + mime-types: 2.1.35 + range-parser: 1.2.1 + schema-utils: 4.0.1 + webpack: 5.90.3(esbuild@0.20.1) + webpack-dev-middleware@5.3.3(webpack@5.91.0): dependencies: colorette: 2.0.20 @@ -25561,7 +25564,7 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 5.3.3(webpack@5.91.0) + webpack-dev-middleware: 5.3.3(webpack@5.90.3(esbuild@0.20.1)) ws: 8.13.0 optionalDependencies: webpack: 5.90.3(esbuild@0.20.1) @@ -25626,37 +25629,6 @@ snapshots: webpack-virtual-modules@0.5.0: {} - webpack@5.90.3: - dependencies: - '@types/eslint-scope': 3.7.4 - '@types/estree': 1.0.5 - '@webassemblyjs/ast': 1.11.6 - '@webassemblyjs/wasm-edit': 1.11.6 - '@webassemblyjs/wasm-parser': 1.11.6 - acorn: 8.9.0 - acorn-import-assertions: 1.9.0(acorn@8.9.0) - browserslist: 4.23.0 - chrome-trace-event: 1.0.3 - enhanced-resolve: 5.15.0 - es-module-lexer: 1.2.1 - eslint-scope: 5.1.1 - events: 3.3.0 - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.0 - mime-types: 2.1.35 - neo-async: 2.6.2 - schema-utils: 3.3.0 - tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(webpack@5.90.3(esbuild@0.20.1)) - watchpack: 2.4.0 - webpack-sources: 3.2.3 - transitivePeerDependencies: - - '@swc/core' - - esbuild - - uglify-js - webpack@5.90.3(esbuild@0.20.1): dependencies: '@types/eslint-scope': 3.7.4