Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint-config-pie): DSW-2294 upgrade eslint to v9 #2004

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

40 changes: 0 additions & 40 deletions .eslintrc.js

This file was deleted.

11 changes: 0 additions & 11 deletions apps/examples/wc-react17/.eslintrc.js

This file was deleted.

13 changes: 13 additions & 0 deletions apps/examples/wc-react17/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default [
{
root: true,
extends: [
require.resolve('@justeattakeaway/eslint-config-pie/strict'),
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
];
10 changes: 0 additions & 10 deletions apps/examples/wc-react18/.eslintrc.js

This file was deleted.

12 changes: 12 additions & 0 deletions apps/examples/wc-react18/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default [
{
extends: [
require.resolve('@justeattakeaway/eslint-config-pie/strict'),
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { vue, vue3 } = require('@justeattakeaway/eslint-config-pie/frameworks');

module.exports = {
Expand Down
3 changes: 0 additions & 3 deletions apps/pie-docs/.eslintignore

This file was deleted.

2 changes: 0 additions & 2 deletions apps/pie-storybook/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line typescript-eslint/no-var-requires
const czConfig = require('./.cz-config.js');

module.exports = {
Expand Down
48 changes: 48 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import eslintConfigPie from '@justeattakeaway/eslint-config-pie/strict';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import importPlugin from 'eslint-plugin-import';
// import jsonPlugin from 'eslint-plugin-json-format';

export default tseslint.config(
eslint.configs.recommended,
importPlugin.flatConfigs.recommended,
...tseslint.configs.recommendedTypeChecked,
...eslintConfigPie,
{
plugins: {
import: importPlugin,
// json: jsonPlugin,
},
root: true,
settings: {
'json/sort-package-json': false,
},
rules: {
'class-methods-use-this': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'no-shadow': 'off',
'no-use-before-define': 'off',
'typescript-eslint/no-var-requires': 'off',
},
overrides: [
// {
// files: ['**/*.ts', '**/*.tsx'],
// parser: '@typescript-eslint/parser',
// parserOptions: {
// project: `${__dirname}/tsconfig.json`,
// },
// },
{
files: ['**/components/**/visual/*.spec.ts'],
rules: {
// ForOfStatement is allowed in Visual tests
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
'no-await-in-loop': 'off',
},
}
],
},
);
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@changesets/cli": "2.26.2",
"@commitlint/cli": "17.5.1",
"@commitlint/config-conventional": "17.4.4",
"@eslint/js": "9.12.0",
"@justeat/pie-design-tokens": "6.5.0",
"@justeattakeaway/browserslist-config-pie": "0.2.0",
"@justeattakeaway/generator-pie-component": "0.23.0",
Expand All @@ -86,10 +87,9 @@
"@playwright/test": "1.41.0",
"@rollup/plugin-node-resolve": "15.1.0",
"@sand4rt/experimental-ct-web": "1.41.0",
"@types/eslint__js": "8.42.3",
"@types/node": "20.4.8",
"@types/react": "18.3.11",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"@vitest/coverage-c8": "0.29.8",
"autoprefixer": "10.4.20",
"babel-loader": "8.3.0",
Expand All @@ -99,10 +99,10 @@
"cz-customizable": "7.2.1",
"danger": "11.3.0",
"dree": "3.4.5",
"eslint": "8.57.0",
"eslint-plugin-import": "2.27.5",
"eslint": "9.12.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-json-format": "2.0.1",
"eslint-plugin-vitest": "0.3.22",
"eslint-plugin-vitest": "0.5.4",
"glob": "10.3.3",
"husky": "8.0.3",
"jsdom": "24.0.0",
Expand All @@ -118,7 +118,8 @@
"stylelint-order": "6.0.4",
"ts-node": "10.9.1",
"turbo": "1.10.16",
"typescript": "5.4.5",
"typescript": "5.6.3",
"typescript-eslint": "8.10.0",
"vite": "5.3.6",
"vite-plugin-dts": "2.3.0",
"vitest": "0.29.8",
Expand Down
6 changes: 0 additions & 6 deletions packages/components/pie-assistive-text/.eslintignore

This file was deleted.

5 changes: 0 additions & 5 deletions packages/components/pie-button/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-card/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-checkbox-group/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-checkbox/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-chip/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-cookie-banner/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-divider/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-form-label/.eslintignore

This file was deleted.

5 changes: 0 additions & 5 deletions packages/components/pie-icon-button/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-link/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-lottie-player/.eslintignore

This file was deleted.

5 changes: 0 additions & 5 deletions packages/components/pie-modal/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-notification/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-radio-group/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/components/pie-radio-group/src/defs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// TODO - please remove the eslint disable comment below when you add props to this interface
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line typescript-eslint/no-empty-interface
export interface RadioGroupProps {}
6 changes: 0 additions & 6 deletions packages/components/pie-radio/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-spinner/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-switch/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-tag/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-text-input/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-textarea/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/pie-toast/.eslintignore

This file was deleted.

5 changes: 0 additions & 5 deletions packages/components/pie-webc-core/.eslintignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const FormControlMixin =
return this._internals.form;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line typescript-eslint/no-explicit-any
constructor (...args: any[]) {
super(...args);
this._internals = this.attachInternals();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* @typedef {new (...args: any[]) => T} Constructor
* @template T
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line typescript-eslint/no-explicit-any
export type GenericConstructor<T> = new (...args: any[]) => T;
3 changes: 0 additions & 3 deletions packages/components/pie-webc-testing/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/components/pie-webc-testing/src/helpers/defs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable typescript-eslint/no-explicit-any */

/**
* This test helper type contains the same keys as the component prop interface.
Expand Down
Loading
Loading