Skip to content

Commit 1e95f39

Browse files
build: use a different dprint config for messages files to allow longer lines
1 parent fc43652 commit 1e95f39

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

dprint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"jest.config.js",
2828
"env.config.*",
2929
"example.env.config.*",
30-
"module.config.js"
30+
"module.config.js",
31+
"**/messages.{ts,js}"
3132
],
3233
"plugins": [
3334
"https://plugins.dprint.dev/typescript-0.95.15.wasm",

dprint.messages.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
// For messages files, we allow unlimited line length, to keep the file format consistent.
3+
// For now a separate file is required, but this could be simplified when
4+
// https://github.com/dprint/dprint/issues/996 is implemented or if we change to a different formatter.
5+
"extends": "dprint.json",
6+
"lineWidth": 10000,
7+
"includes": ["src/**/messages.{ts,js}"]
8+
// Because this inherits "excludes" from "dprint.json", it's necessary to use "--excludes-override none"
9+
// to run this on the command line.
10+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"build": "fedx-scripts webpack",
1414
"i18n_extract": "fedx-scripts formatjs extract --include=plugins",
1515
"stylelint": "stylelint \"plugins/**/*.scss\" \"src/**/*.scss\" \"scss/**/*.scss\" --config .stylelintrc.json",
16-
"lint": "dprint check && oxlint --type-aware --deny-warnings && npm run stylelint",
17-
"lint:fix": "dprint fmt && oxlint --type-aware --fix",
16+
"lint": "dprint check && dprint --config dprint.messages.json check --excludes-override none && oxlint --type-aware --deny-warnings && npm run stylelint",
17+
"lint:fix": "dprint fmt && dprint --config dprint.messages.json fmt --excludes-override none && oxlint --type-aware --fix",
1818
"start": "fedx-scripts webpack-dev-server --progress",
1919
"start:with-theme": "paragon install-theme && npm start && npm install",
2020
"dev": "PUBLIC_PATH=/authoring/ MFE_CONFIG_API_URL='http://localhost:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",

0 commit comments

Comments
 (0)