Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Add support ESLint 8 #137

Merged
merged 6 commits into from
Jan 5, 2022
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
8 changes: 3 additions & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"packages": [
"packages/*"
],
"version": "0.7.0",
"npmClient": "yarn"
"version": "0.7.0",
"npmClient": "yarn",
"useWorkspaces": true
}
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"lint": "eslint --ext .js,.ts,.jsx,.tsx packages",
"release": "lerna publish"
Expand All @@ -9,15 +12,9 @@
"@guardian/eslint-config": "file:packages/eslint-config",
"@guardian/eslint-config-typescript": "file:packages/eslint-config-typescript",
"@guardian/prettier": "file:packages/prettier",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"eslint": "^7.28.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"eslint": "8.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

8.4.1 is the latest, should we be using that instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea was to install the minimum possible version in the workspace that our packages should work with, to make using them as flexible as possible without accidentally using features added after the minimum version

"lerna": "^4.0.0",
"prettier": "^2.3.1",
"typescript": "^4.3.2"
"prettier": "2.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: is there a reason we must pin to this specific version of prettier, or can we specify a ^ range in keeping with other devDeps?

Copy link
Member Author

Choose a reason for hiding this comment

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

2.4 has the new brackets flag config, so this becomes the minimum version the workspace should work with

Copy link
Contributor

Choose a reason for hiding this comment

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

I get ya. So the general rule is:

  • in peerDependencies, specify the minimum supported version of a package, using a ^ to pin the major version and enforce a minimum minor version
  • in devDependencies, specify the minimum supported version of a package, using the exact version (i.e. no ^ or ~)

Copy link
Member Author

Choose a reason for hiding this comment

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

that's was the thinking yeah – make it as flexible as possible to consume, but make sure we develop with the smallest possible feature set we need. and then obvs if we need a feature from a later version that becomes the baseline

"typescript": "4.0.2"
}
}
9 changes: 5 additions & 4 deletions packages/eslint-config-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
"url": "https://github.com/guardian/configs/issues"
},
"dependencies": {
"@guardian/eslint-config": "^0.7.0",
"@typescript-eslint/eslint-plugin": "4.29.2",
"@typescript-eslint/parser": "4.29.2"
"@guardian/eslint-config": "0.7.0",
"@typescript-eslint/eslint-plugin": "5.6.0",
"@typescript-eslint/parser": "5.6.0"
},
"peerDependencies": {
"typescript": "^4.0.0"
"eslint": "^8.0.0",
"typescript": "^4.0.2"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"dependencies": {
"eslint-config-prettier": "8.3.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.24.0",
"eslint-plugin-prettier": "3.4.0"
"eslint-plugin-import": "2.25.3",
"eslint-plugin-prettier": "4.0.0"
},
"peerDependencies": {
"eslint": "^7.0.0"
"eslint": "^8.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/prettier/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
arrowParens: 'always',
bracketSpacing: true,
jsxBracketSameLine: false,
bracketSameLine: false,
jsxSingleQuote: false,
printWidth: 80,
quoteProps: 'as-needed',
Expand Down
2 changes: 1 addition & 1 deletion packages/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"url": "https://github.com/guardian/configs/issues"
},
"peerDependencies": {
"prettier": "^2.0.0"
"prettier": "^2.4.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why force consumers to upgrade? Are we using features that were added after 2.0.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah the new new brackets config comes with 2.4

},
"publishConfig": {
"access": "public"
Expand Down
Loading