Skip to content

Commit ceb882f

Browse files
tjenkinsonlennyburdetteshellscape
authored
chore(repo): Enforce prettier on CI (#941)
* fix(dynamic-import-vars): allow ./${var}.suffix.js (#834) Allow dynamically importing files in the same directory with an extra suffix before the extension. * enforce `prettier` is happy on CI * run prettier on more things in precommit and do not pass `--single-quote` to use the value in the config * run `pnpm run prettier` * remove redundant `--plugin` option because it will be loaded automatically given it's in the config * chore: add changelogs to docs lint Co-authored-by: Lenny Burdette <[email protected]> Co-authored-by: Andrew Powell <[email protected]> Co-authored-by: shellscape <[email protected]>
1 parent d2d568e commit ceb882f

File tree

13 files changed

+149
-143
lines changed

13 files changed

+149
-143
lines changed

.eslintrc.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ module.exports = {
1111
},
1212
overrides: [
1313
{
14-
'files': ['**/fixtures/**'],
15-
'rules': {
14+
files: ['**/fixtures/**'],
15+
rules: {
1616
'no-console': 'off',
1717
'import/extensions': 'off',
1818
'import/no-unresolved': 'off'
1919
}
2020
},
2121
{
22-
'files': ['**/test/**'],
23-
'rules': {
22+
files: ['**/test/**'],
23+
rules: {
2424
'import/extensions': 'off'
2525
}
2626
}
27-
],
27+
]
2828
};

.github/CODE_OF_CONDUCT.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
88

99
Examples of behavior that contributes to creating a positive environment include:
1010

11-
* Using welcoming and inclusive language
12-
* Being respectful of differing viewpoints and experiences
13-
* Gracefully accepting constructive criticism
14-
* Focusing on what is best for the community
15-
* Showing empathy towards other community members
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
1616

1717
Examples of unacceptable behavior by participants include:
1818

19-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20-
* Trolling, insulting/derogatory comments, and personal or political attacks
21-
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23-
* Other conduct which could reasonably be considered inappropriate in a professional setting
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
2424

2525
## Our Responsibilities
2626

.github/labels.json

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
[
2-
{ "name": "💩 template incomplete", "color": "#4E342E" },
3-
{ "name": "💩 template removed", "color": "#4E342E" },
4-
5-
{ "name": "b¹ 🐞 code-splitting", "color": "#F44336" },
6-
{ "name": "b² 🐞 scope-hoisting", "color": "#F44336" },
7-
{ "name": "b³ 🐞 tree-shaking", "color": "#F44336" },
8-
9-
{ "name": "c¹ ⋅ discussion", "color": "#1976D2" },
10-
{ "name": "c² ⋅ feedback wanted", "color": "#F9A825" },
11-
{ "name": "c³ ⋅ PR welcome", "color": "#1B5E20" },
12-
{ "name": "c⁴ ⋅ need more info", "color": "#6A1B9A" },
13-
{ "name": "c⁵ ⋅ question", "color": "#C2185B" },
14-
{ "name": "c⁶ ⋅ request for comments", "color": "#BBDEFB" },
15-
16-
{ "name": "p¹ ⋅ browser", "color": "#B2DFDB" },
17-
{ "name": "p² ⋅ linux", "color": "#B2DFDB" },
18-
{ "name": "p³ ⋅ mac", "color": "#B2DFDB" },
19-
{ "name": "p⁴ ⋅ windows", "color": "#B2DFDB" },
20-
21-
{ "name": "pr¹ 🔧 chore", "color": "#D7CCC8" },
22-
{ "name": "pr² 🔧 docs", "color": "#D7CCC8" },
23-
{ "name": "pr³ 🔧 feature", "color": "#D7CCC8" },
24-
{ "name": "pr⁴ 🔧 fix", "color": "#D7CCC8" },
25-
{ "name": "pr⁵ 🔧 performance", "color": "#D7CCC8" },
26-
{ "name": "pr⁶ 🔧 refactor", "color": "#D7CCC8" },
27-
{ "name": "pr⁷ 🔧 style", "color": "#D7CCC8" },
28-
{ "name": "pr⁸ 🔧 test", "color": "#D7CCC8" },
29-
30-
{ "name": "s¹ 🔥🔥🔥 critical", "color": "#E53935" },
31-
{ "name": "s² 🔥🔥 important", "color": "#FB8C00" },
32-
{ "name": "s³ 🔥 nice to have", "color": "#FDD835" },
33-
{ "name": "s⁴ 💧 low", "color": "#039BE5" },
34-
{ "name": "s⁵ 💧💧 inconvenient", "color": "#c0e0f7" },
35-
36-
{ "name": "t¹ 🐞 bug", "color": "#F44336" },
37-
{ "name": "t² 📚 documentation", "color": "#FDD835" },
38-
{ "name": "t³ ✨ enhancement", "color": "#03a9f4" },
39-
{ "name": "t⁴ ⋅ regression", "color": "#0052cc" },
40-
{ "name": "t⁵ ⋅ todo", "color": "#311B92" },
41-
{ "name": "t⁶ ⋅ waiting on upstream", "color": "#0D47A1" },
42-
43-
{ "name": "v¹ ⋅ major", "color": "#CDDC39" },
44-
{ "name": "v² ⋅ minor", "color": "#FF9800" },
45-
{ "name": "v³ ⋅ minor (experimental)", "color": "#FFC107" },
46-
47-
{ "name": "x¹ ⋅ abandoned", "color": "#CFD8DC" },
48-
{ "name": "x² ⋅ could not reproduce", "color": "#CFD8DC" },
49-
{ "name": "x³ ⋅ duplicate", "color": "#CFD8DC" },
50-
{ "name": "x⁴ ⋅ hold", "color": "#CFD8DC" },
51-
{ "name": "x⁵ ⋅ in progress", "color": "#4CAF50" },
52-
{ "name": "x⁶ ⋅ invalid", "color": "#CFD8DC" },
53-
{ "name": "x⁷ ⋅ wontfix", "color": "#CFD8DC" }
2+
{ "name": "💩 template incomplete", "color": "#4E342E" },
3+
{ "name": "💩 template removed", "color": "#4E342E" },
4+
5+
{ "name": "b¹ 🐞 code-splitting", "color": "#F44336" },
6+
{ "name": "b² 🐞 scope-hoisting", "color": "#F44336" },
7+
{ "name": "b³ 🐞 tree-shaking", "color": "#F44336" },
8+
9+
{ "name": "c¹ ⋅ discussion", "color": "#1976D2" },
10+
{ "name": "c² ⋅ feedback wanted", "color": "#F9A825" },
11+
{ "name": "c³ ⋅ PR welcome", "color": "#1B5E20" },
12+
{ "name": "c⁴ ⋅ need more info", "color": "#6A1B9A" },
13+
{ "name": "c⁵ ⋅ question", "color": "#C2185B" },
14+
{ "name": "c⁶ ⋅ request for comments", "color": "#BBDEFB" },
15+
16+
{ "name": "p¹ ⋅ browser", "color": "#B2DFDB" },
17+
{ "name": "p² ⋅ linux", "color": "#B2DFDB" },
18+
{ "name": "p³ ⋅ mac", "color": "#B2DFDB" },
19+
{ "name": "p⁴ ⋅ windows", "color": "#B2DFDB" },
20+
21+
{ "name": "pr¹ 🔧 chore", "color": "#D7CCC8" },
22+
{ "name": "pr² 🔧 docs", "color": "#D7CCC8" },
23+
{ "name": "pr³ 🔧 feature", "color": "#D7CCC8" },
24+
{ "name": "pr⁴ 🔧 fix", "color": "#D7CCC8" },
25+
{ "name": "pr⁵ 🔧 performance", "color": "#D7CCC8" },
26+
{ "name": "pr⁶ 🔧 refactor", "color": "#D7CCC8" },
27+
{ "name": "pr⁷ 🔧 style", "color": "#D7CCC8" },
28+
{ "name": "pr⁸ 🔧 test", "color": "#D7CCC8" },
29+
30+
{ "name": "s¹ 🔥🔥🔥 critical", "color": "#E53935" },
31+
{ "name": "s² 🔥🔥 important", "color": "#FB8C00" },
32+
{ "name": "s³ 🔥 nice to have", "color": "#FDD835" },
33+
{ "name": "s⁴ 💧 low", "color": "#039BE5" },
34+
{ "name": "s⁵ 💧💧 inconvenient", "color": "#c0e0f7" },
35+
36+
{ "name": "t¹ 🐞 bug", "color": "#F44336" },
37+
{ "name": "t² 📚 documentation", "color": "#FDD835" },
38+
{ "name": "t³ ✨ enhancement", "color": "#03a9f4" },
39+
{ "name": "t⁴ ⋅ regression", "color": "#0052cc" },
40+
{ "name": "t⁵ ⋅ todo", "color": "#311B92" },
41+
{ "name": "t⁶ ⋅ waiting on upstream", "color": "#0D47A1" },
42+
43+
{ "name": "v¹ ⋅ major", "color": "#CDDC39" },
44+
{ "name": "v² ⋅ minor", "color": "#FF9800" },
45+
{ "name": "v³ ⋅ minor (experimental)", "color": "#FFC107" },
46+
47+
{ "name": "x¹ ⋅ abandoned", "color": "#CFD8DC" },
48+
{ "name": "x² ⋅ could not reproduce", "color": "#CFD8DC" },
49+
{ "name": "x³ ⋅ duplicate", "color": "#CFD8DC" },
50+
{ "name": "x⁴ ⋅ hold", "color": "#CFD8DC" },
51+
{ "name": "x⁵ ⋅ in progress", "color": "#4CAF50" },
52+
{ "name": "x⁶ ⋅ invalid", "color": "#CFD8DC" },
53+
{ "name": "x⁷ ⋅ wontfix", "color": "#CFD8DC" }
5454
]

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- name: pnpm install
5151
run: pnpm install
5252

53+
- name: Prettier
54+
run: pnpm run prettier:check
55+
5356
- name: Build Packages
5457
run: pnpm build --recursive
5558

.github/workflows/validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
- name: pnpm install
4343
run: pnpm install
4444

45+
- name: Prettier
46+
run: pnpm run prettier:check
47+
4548
# pnpm audit isn't as robust as it needs to be atm
4649
# - name: Audit Dependencies
4750
# run: pnpm security

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
.github/PULL_REQUEST_TEMPLATE.md
44
packages/json/test/fixtures/garbage/*
55
packages/yaml/test/fixtures/**/*
6-
**/dist
6+
**/dist/
7+
**/fixtures/
8+
pnpm-lock.yaml

.vscode/launch.json

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"type": "node",
9-
"request": "launch",
10-
"name": "Mocha Tests",
11-
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
12-
"args": [
13-
"-u",
14-
"tdd",
15-
"--timeout",
16-
"999999",
17-
"--colors"
18-
],
19-
"console": "integratedTerminal"
20-
}
21-
]
22-
}
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Mocha Tests",
11+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
12+
"args": ["-u", "tdd", "--timeout", "999999", "--colors"],
13+
"console": "integratedTerminal"
14+
}
15+
]
16+
}

codecov.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ coverage:
55
round: down
66
range: 70...100
77
status:
8-
project: "no"
9-
patch: "yes"
10-
comment: "off"
8+
project: 'no'
9+
patch: 'yes'
10+
comment: 'off'

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
"scripts": {
55
"ci:coverage:submit": "node scripts/codecov",
66
"lint": "pnpm lint:docs && pnpm --no-bail lint:json && pnpm lint:package && pnpm lint:js",
7-
"lint:docs": "prettier --write .github/**/*.md **/README.md",
7+
"lint:docs": "prettier --write .github/**/*.md **/README.md **/CHANGELOG.md",
88
"lint:js": "eslint --cache packages scripts shared util --ext .js,.ts",
99
"lint:json": "prettier --write .github/**/*.yml **/tsconfig.json tsconfig.*.json pnpm-workspace.yaml",
10-
"lint:package": "prettier --write **/package.json --plugin=prettier-plugin-package",
10+
"lint:package": "prettier --write **/package.json",
1111
"plugin:release": "ts-node ./scripts/release.ts",
1212
"preinstall": "node scripts/disallow-npm.js",
13+
"prettier": "prettier --write .",
14+
"prettier:check": "prettier --check .",
1315
"security": "pnpm audit --audit-level=high"
1416
},
1517
"devDependencies": {
@@ -61,11 +63,8 @@
6163
"*.{ts,js}": [
6264
"eslint --fix"
6365
],
64-
"*.md": [
65-
"prettier --single-quote --write"
66-
],
67-
"*package.json": [
68-
"prettier --write --plugin=prettier-plugin-package"
66+
"*.{ts,js,json,yaml,yml,md}": [
67+
"prettier --write"
6968
]
7069
},
7170
"nyc": {

packages/dynamic-import-vars/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ _2020-08-13_
6969

7070
_2020-07-06_
7171

72-
- First release
72+
- First release

0 commit comments

Comments
 (0)