Skip to content

Commit 28f3a82

Browse files
sookburtSue Burttomrf1
authored
Bump guardian/libs and eslint - include new config and fixes (#1316)
* bump guardian/libs to 22.0.1 plus associated peer dependencies and eslint config file change * add rules and ignores * first run of new eslint config fix * Turn off all rules for now with a view to fixing later or retaining * second pass of --fix * Add link to trello card for fixing later * Remove old eslint config files * Fix eslint script + config * auto lint fixes * unnecessary export * exclude rules * exclude cdk * fix cdk lint script * Move to use ACQUISITIONS_GUTTER * Revert - to be done in a separate PR --------- Co-authored-by: Sue Burt <“sue.burt@guardian.co.uk”> Co-authored-by: Tom Forbes <tom.forbes@theguardian.com>
1 parent 3ef0787 commit 28f3a82

File tree

101 files changed

+1177
-819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1177
-819
lines changed

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

cdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "jest",
88
"test-update": "jest -u",
99
"format": "prettier --write \"{lib,bin}/**/*.ts\"",
10-
"lint": "eslint lib/** bin/** --ext .ts --no-error-on-unmatched-pattern",
10+
"lint": "eslint lib/** bin/** --no-error-on-unmatched-pattern",
1111
"synth": "cdk synth --path-metadata false --version-reporting false",
1212
"diff": "cdk diff --path-metadata false --version-reporting false"
1313
},

eslint.config.mjs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import guardian from '@guardian/eslint-config';
2+
import globals from 'globals';
3+
4+
export default [
5+
{
6+
ignores: [
7+
'node_modules',
8+
'dist',
9+
'server-dist',
10+
11+
'rollup.config.js',
12+
'webpack.*js',
13+
'cdk',
14+
],
15+
},
16+
...guardian.configs.recommended,
17+
...guardian.configs.jest,
18+
{
19+
ignores: ['eslint.config.mjs'],
20+
languageOptions: {
21+
globals: {
22+
...globals.jest,
23+
...globals.browser,
24+
...globals.node,
25+
},
26+
ecmaVersion: 5,
27+
sourceType: 'commonjs',
28+
parserOptions: {
29+
project: ['./tsconfig.json'],
30+
tsconfigRootDir: './',
31+
},
32+
},
33+
rules: {
34+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
35+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
36+
curly: 2,
37+
// '@typescript-eslint/no-unused-vars': [
38+
// 'error',
39+
// {
40+
// args: 'after-used',
41+
// ignoreRestSiblings: true,
42+
// },
43+
// ],
44+
45+
// potentially to fix later see https://trello.com/c/lc8lG7Zj
46+
'@typescript-eslint/naming-convention': 'off',
47+
'@eslint-community/eslint-comments/require-description': 'off',
48+
'@typescript-eslint/ban-types': 'off',
49+
'@typescript-eslint/no-unsafe-function-type': 'off',
50+
'@typescript-eslint/no-unnecessary-condition': 'off',
51+
'@typescript-eslint/no-unsafe-assignment': 'off',
52+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
53+
'@typescript-eslint/no-unsafe-member-access': 'off',
54+
'@typescript-eslint/require-await': 'off',
55+
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
56+
'@typescript-eslint/no-unsafe-argument': 'off',
57+
'@typescript-eslint/no-unsafe-return': 'off',
58+
'@typescript-eslint/no-base-to-string': 'off',
59+
'@typescript-eslint/prefer-promise-reject-errors': 'off',
60+
'@typescript-eslint/no-unsafe-call': 'off',
61+
'@typescript-eslint/no-floating-promise': 'off',
62+
'@typescript-eslint/no-unused-vars': 'off',
63+
'@typescript-eslint/restrict-template-expressions': 'off',
64+
'@typescript-eslint/no-floating-promises': 'off',
65+
'@typescript-eslint/prefer-optional-chain': 'off',
66+
'@typescript-eslint/await-thenable': 'off',
67+
},
68+
},
69+
];

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
"build-dotcom-types": "tsc --project tsconfig.types.json",
2222
"publish-dry-run": "pnpm publish --dry-run",
2323
"publish": "pnpm publish",
24-
"lint": "eslint 'src/**/*.{ts,tsx}'",
24+
"lint": "eslint .",
2525
"test": "export stage=DEV; jest",
2626
"riffraff": "node-riffraff-artifact"
2727
},
2828
"devDependencies": {
2929
"@babel/core": "^7.23.2",
3030
"@babel/preset-typescript": "^7.23.2",
3131
"@changesets/cli": "^2.26.2",
32-
"@guardian/eslint-config-typescript": "^7.0.0",
32+
"@guardian/eslint-config": "^11.0.0",
3333
"@guardian/node-riffraff-artifact": "^0.3.2",
3434
"@guardian/prettier": "^5.0.0",
3535
"@rollup/plugin-alias": "^3.1.1",
@@ -48,32 +48,33 @@
4848
"babel-loader": "^9.1.3",
4949
"body-parser": "^1.20.3",
5050
"concurrently": "^6.2.0",
51-
"eslint": "^8.47.0",
51+
"eslint": "^9.19.0",
5252
"eslint-plugin-prettier": "5.1.3",
5353
"eslint-plugin-react": "^7.33.2",
5454
"fishery": "^0.3.0",
55+
"globals": "15.14.0",
5556
"inquirer": "^7.0.3",
5657
"jest": "^29.7.0",
5758
"nodemon": "^3.1.7",
5859
"prettier": "^3.0.0",
5960
"rollup": "^2.79.2",
60-
"rollup-plugin-external-globals": "^0.5.0",
61+
"rollup-plugin-external-globals": "^0.13.0",
6162
"rollup-plugin-filesize": "^9.0.2",
6263
"rollup-plugin-peer-deps-external": "^2.2.3",
6364
"rollup-plugin-terser": "^7.0.2",
6465
"ts-jest": "^29.1.1",
6566
"ts-loader": "^9.2.5",
6667
"ts-node-dev": "^2.0.0",
6768
"tslib": "^2.5.3",
68-
"typescript": "~5.1.3",
69+
"typescript": "~5.5.2",
6970
"typescript-json-schema": "^0.42.0",
7071
"webpack": "^5.94.0",
7172
"webpack-cli": "^4.7.2",
7273
"webpack-merge": "^5.8.0",
7374
"zod": "3.22.4"
7475
},
7576
"dependencies": {
76-
"@guardian/libs": "17.0.0",
77+
"@guardian/libs": "22.0.1",
7778
"aws-sdk": "^2.862.0",
7879
"compression": "1.7.4",
7980
"cors": "^2.8.5",
@@ -86,7 +87,7 @@
8687
"zod": "3.22.4"
8788
},
8889
"peerDependencies": {
89-
"@guardian/libs": "^17.0.0",
90+
"@guardian/libs": "^22.0.0",
9091
"zod": "^3.22.4"
9192
},
9293
"packageManager": "pnpm@8.15.7"

0 commit comments

Comments
 (0)