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

Use ESLint 9 to lint libs/** #1668

Merged
merged 18 commits into from
Sep 6, 2024
Merged
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
64 changes: 0 additions & 64 deletions .eslintrc.cjs

This file was deleted.

4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,6 @@ install: check-node-version
@guardian/source\:verify-dist: env
@corepack pnpm --filter @guardian/source verify-dist

.PHONY: @guardian/source\:wireit
@guardian/source\:wireit: env
@corepack pnpm --filter @guardian/source wireit

.PHONY: @guardian/source-development-kitchen\:build
@guardian/source-development-kitchen\:build: env
@corepack pnpm --filter @guardian/source-development-kitchen build
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ Project-specific tasks are defined as `scripts` in their `package.json`, and can
- `make @guardian/source:test`
- `make @guardian/source:tsc`
- `make @guardian/source:verify-dist`
- `make @guardian/source:wireit`

#### @guardian/source-development-kitchen

Expand Down
33 changes: 0 additions & 33 deletions libs/@guardian/ab-core/.eslintrc.cjs

This file was deleted.

14 changes: 14 additions & 0 deletions libs/@guardian/ab-core/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import guardian from '@guardian/eslint-config';

export default [
...guardian.configs.recommended,
...guardian.configs.jest,
{
ignores: [
'node_modules',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ignored automatically by eslint, can see the argument for writing it anyway

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'node_modules',

'dist',
'jest.dist.*', // depends on build output, so don't lint it
'.wireit',
],
},
];
1 change: 0 additions & 1 deletion libs/@guardian/ab-core/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ const config = {
testEnvironment: 'jest-environment-jsdom',
};

// eslint-disable-next-line import/no-default-export -- that's what jest likes
export default config;
4 changes: 2 additions & 2 deletions libs/@guardian/ab-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"verify-dist": "wireit"
},
"devDependencies": {
"@guardian/eslint-config": "workspace:*",
"@types/jest": "29.5.8",
"eslint": "9.9.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"rollup": "4.21.0",
Expand Down Expand Up @@ -65,7 +67,6 @@
"command": "eslint --cache --color . --fix",
"files": [
"**",
"../../../.eslint*",
"!(dist)/**",
"!.eslintcache"
],
Expand All @@ -78,7 +79,6 @@
"command": "eslint --cache --color .",
"files": [
"**",
"../../../.eslint*",
"!(dist)/**",
"!.eslintcache"
],
Expand Down
33 changes: 0 additions & 33 deletions libs/@guardian/ab-react/.eslintrc.cjs

This file was deleted.

15 changes: 15 additions & 0 deletions libs/@guardian/ab-react/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import guardian from '@guardian/eslint-config';

export default [
...guardian.configs.recommended,
...guardian.configs.jest,
...guardian.configs.react,
{
ignores: [
'node_modules',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'node_modules',

'dist',
'jest.dist.*', // depends on build output, so don't lint it
'.wireit',
],
},
];
2 changes: 0 additions & 2 deletions libs/@guardian/ab-react/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/no-default-export -- that's what jest likes */

import { config as baseConfig } from '../../../configs/jest.config.js';

/** @typedef {import("jest").Config} Config */
Expand Down
4 changes: 2 additions & 2 deletions libs/@guardian/ab-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
},
"devDependencies": {
"@guardian/ab-core": "8.0.0",
"@guardian/eslint-config": "workspace:*",
"@testing-library/react": "14.2.1",
"@types/jest": "29.5.8",
"@types/react": "18.2.79",
"eslint": "9.9.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"react": "18.2.0",
Expand Down Expand Up @@ -88,7 +90,6 @@
],
"files": [
"**",
"../../../.eslint*",
"!(dist)/**",
"!.eslintcache"
],
Expand All @@ -104,7 +105,6 @@
],
"files": [
"**",
"../../../.eslint*",
"!(dist)/**",
"!.eslintcache"
],
Expand Down
24 changes: 0 additions & 24 deletions libs/@guardian/browserslist-config/.eslintrc.cjs

This file was deleted.

8 changes: 8 additions & 0 deletions libs/@guardian/browserslist-config/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import guardian from '@guardian/eslint-config';

export default [
...guardian.configs.recommended,
{
ignores: ['node_modules', '.wireit'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ignores: ['node_modules', '.wireit'],
ignores: ['.wireit'],

},
];
4 changes: 2 additions & 2 deletions libs/@guardian/browserslist-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
},
"devDependencies": {
"@guardian/browserslist-config": "workspace:*",
"@guardian/eslint-config": "workspace:*",
"browserslist": "4.23.0",
"eslint": "9.9.0",
"tslib": "2.6.2",
"wireit": "0.14.8"
},
Expand All @@ -32,7 +34,6 @@
"clean": false,
"files": [
"**",
"../../../.eslint*",
"!.eslintcache"
],
"output": [
Expand All @@ -43,7 +44,6 @@
"command": "eslint --cache --color .",
"files": [
"**",
"../../../.eslint*",
"!.eslintcache"
],
"output": []
Expand Down
6 changes: 5 additions & 1 deletion libs/@guardian/browserslist-config/scripts/usage-table.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import browserslistStats from '../browserslist-stats.json' assert { type: 'json' };
import { readFileSync } from 'fs';
import { normaliseBrowserName } from './normalise-browser-name.mjs';

const browserslistStats = JSON.parse(
readFileSync('../browserslist-stats.json'),
);

const flattened = {};

// flatten the stats to { browserVersion: usage } shape
Expand Down
37 changes: 0 additions & 37 deletions libs/@guardian/core-web-vitals/.eslintrc.cjs

This file was deleted.

14 changes: 14 additions & 0 deletions libs/@guardian/core-web-vitals/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import guardian from '@guardian/eslint-config';

export default [
...guardian.configs.recommended,
...guardian.configs.jest,
{
ignores: [
'node_modules',
sndrs marked this conversation as resolved.
Show resolved Hide resolved
'dist',
'jest.dist.*', // depends on build output, so don't lint it
'.wireit',
],
},
];
2 changes: 0 additions & 2 deletions libs/@guardian/core-web-vitals/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/no-default-export -- that's what jest likes */

import { config as baseConfig } from '../../../configs/jest.config.js';

/** @typedef {import("jest").Config} Config */
Expand Down
Loading