Skip to content

Commit e1ead85

Browse files
authored
chore(configs): alias prettier and eslint bins through the local config packages (#6822)
* chore(configs): re-export eslint and prettier clis through config packages * chore(configs): remove eslint and prettier from package dependencies * chore(prettier-config): fix prettier bin path; ensure all scripts are calling the alias * chore(prettier-config): remove configs and ignore files from workspaces * fix(editor): editor actually depends on prettier * chore(scripts): cleanup create-workspaces script
1 parent f06c28b commit e1ead85

File tree

195 files changed

+9353
-8931
lines changed

Some content is hidden

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

195 files changed

+9353
-8931
lines changed

.husky/pre-commit

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
# listings staged files only
55
fileList=$(git diff --diff-filter=AM --cached --name-only)
66

7-
npm run precommit $fileList
7+
if [ -n "$fileList" ]; then
8+
echo "Prettifying staged files..."
9+
npx prettier-compass --write --ignore-unknown $fileList
10+
git add $fileList
11+
fi
File renamed without changes.

THIRD-PARTY-NOTICES.md

Lines changed: 9105 additions & 8153 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
require('eslint/bin/eslint.js');

configs/eslint-config-compass/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44
"description": "Shared Compass eslint configuration",
55
"license": "SSPL",
66
"main": "index.js",
7+
"bin": {
8+
"eslint-compass": "./bin/eslint.js"
9+
},
710
"files": [
811
"index.js",
12+
"bin",
913
"package.json",
1014
"README.md"
1115
],
12-
"peerDependencies": {
13-
"eslint": "^7.25.0"
14-
},
1516
"dependencies": {
1617
"@babel/core": "^7.21.4",
1718
"@babel/eslint-parser": "^7.14.3",
1819
"@mongodb-js/eslint-config-devtools": "^0.9.9",
1920
"@mongodb-js/eslint-plugin-compass": "^1.2.6",
2021
"@typescript-eslint/eslint-plugin": "^5.59.0",
2122
"@typescript-eslint/parser": "^5.59.0",
23+
"eslint": "^7.25.0",
2224
"eslint-config-prettier": "^8.3.0",
2325
"eslint-plugin-filename-rules": "^1.2.0",
2426
"eslint-plugin-jsx-a11y": "^6.4.1",
2527
"eslint-plugin-mocha": "^8.0.0",
2628
"eslint-plugin-react": "^7.24.0",
2729
"eslint-plugin-react-hooks": "^4.2.0"
2830
},
29-
"devDependencies": {
30-
"prettier": "^2.7.1"
31-
},
3231
"scripts": {
32+
"prettier": "prettier-compass",
3333
"check": "npm run lint",
34-
"lint": "prettier --check .",
35-
"reformat": "prettier --write ."
34+
"lint": "npm run prettier -- --check .",
35+
"reformat": "npm run prettier -- --write ."
3636
},
3737
"repository": {
3838
"type": "git",

configs/eslint-plugin-compass/.prettierignore

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

configs/eslint-plugin-compass/.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

configs/eslint-plugin-compass/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"license": "SSPL",
2525
"main": "index.js",
2626
"scripts": {
27-
"eslint": "eslint",
28-
"prettier": "prettier",
27+
"eslint": "eslint-compass",
28+
"prettier": "prettier-compass",
2929
"lint": "npm run eslint . && npm run prettier -- --check .",
3030
"depcheck": "depcheck",
3131
"check": "npm run lint && npm run depcheck",
@@ -42,7 +42,6 @@
4242
"depcheck": "^1.4.1",
4343
"eslint": "^7.25.0",
4444
"mocha": "^10.2.0",
45-
"nyc": "^15.1.0",
46-
"prettier": "^2.7.1"
45+
"nyc": "^15.1.0"
4746
}
4847
}

configs/mocha-config-compass/.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

configs/mocha-config-compass/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
"license": "SSPL",
66
"main": "index.js",
77
"devDependencies": {
8-
"@mongodb-js/prettier-config-compass": "^1.2.6",
9-
"prettier": "^2.7.1"
8+
"@mongodb-js/prettier-config-compass": "^1.2.6"
109
},
1110
"scripts": {
12-
"prettier": "prettier",
11+
"prettier": "prettier-compass",
1312
"lint": "npm run prettier -- --check .",
1413
"check": "npm run lint",
1514
"check-ci": "npm run lint",
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.nyc_output
2+
.nyc-output
23
dist
34
coverage

configs/prettier-config-compass/.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
const path = require('path');
4+
const fs = require('fs');
5+
if (process.argv.some((arg) => /^--(no-)?config/.test(arg))) {
6+
throw new Error('--config option is not allowed');
7+
}
8+
process.argv.push('--config', path.resolve(__dirname, '..', 'index.js'));
9+
if (!fs.existsSync(path.resolve(process.cwd(), '.prettierignore'))) {
10+
process.argv.push(
11+
'--ignore-path',
12+
path.resolve(__dirname, '..', '.prettierignore-default')
13+
);
14+
}
15+
require('prettier/bin-prettier.js');

configs/prettier-config-compass/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44
"description": "Shared Compass prettier configuration",
55
"license": "SSPL",
66
"main": "index.js",
7+
"bin": {
8+
"prettier-compass": "./bin/prettier.js"
9+
},
710
"peerDependencies": {
811
"prettier": "^2.7.1"
912
},
1013
"devDependencies": {
11-
"prettier": "^2.7.1",
1214
"@mongodb-js/prettier-config-devtools": "^1.0.1"
1315
},
1416
"scripts": {
17+
"prettier": "prettier-compass",
1518
"check": "npm run lint",
16-
"lint": "prettier --check .",
17-
"reformat": "prettier --write ."
19+
"lint": "npm run prettier -- --check .",
20+
"reformat": "npm run prettier -- --write ."
1821
},
1922
"repository": {
2023
"type": "git",

configs/testing-library-compass/.prettierignore

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

configs/testing-library-compass/.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

configs/testing-library-compass/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"scripts": {
3333
"compile": "tsc -p tsconfig.json",
3434
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
35-
"eslint": "eslint",
36-
"prettier": "prettier",
35+
"eslint": "eslint-compass",
36+
"prettier": "prettier-compass",
3737
"lint": "npm run eslint . && npm run prettier -- --check .",
3838
"depcheck": "depcheck",
3939
"check": "npm run typecheck && npm run lint && npm run depcheck",
@@ -54,10 +54,8 @@
5454
"@types/sinon-chai": "^3.2.5",
5555
"chai": "^4.3.6",
5656
"depcheck": "^1.4.1",
57-
"eslint": "^7.25.0",
5857
"mocha": "^10.2.0",
5958
"nyc": "^15.1.0",
60-
"prettier": "^2.7.1",
6159
"typescript": "^5.0.4"
6260
},
6361
"dependencies": {

configs/tsconfig-compass/.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

configs/tsconfig-compass/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"typescript": "^5.0.4"
1212
},
1313
"devDependencies": {
14-
"@mongodb-js/prettier-config-compass": "^1.2.6",
15-
"prettier": "^2.7.1"
14+
"@mongodb-js/prettier-config-compass": "^1.2.6"
1615
},
1716
"dependencies": {
1817
"@mongodb-js/tsconfig-devtools": "^1.0.0"

configs/webpack-config-compass/.prettierignore

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

configs/webpack-config-compass/.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

configs/webpack-config-compass/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
3737
"compile": "tsc -p tsconfig.json",
3838
"postcompile": "gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
39-
"eslint": "eslint",
40-
"prettier": "prettier",
39+
"eslint": "eslint-compass",
40+
"prettier": "prettier-compass",
4141
"lint": "npm run eslint . && npm run prettier -- --check .",
4242
"depcheck": "depcheck",
4343
"check": "npm run lint && npm run depcheck",
@@ -52,8 +52,6 @@
5252
"@types/html-webpack-plugin": "^3.2.9",
5353
"@types/webpack-bundle-analyzer": "^4.7.0",
5454
"depcheck": "^1.4.1",
55-
"eslint": "^7.25.0",
56-
"prettier": "^2.7.1",
5755
"typescript": "^5.0.4"
5856
},
5957
"dependencies": {

0 commit comments

Comments
 (0)