Skip to content

Commit 9b91ba6

Browse files
committed
fix(scripts): apply Liferay-specific Prettier overrides to TS also
Noticed while testing a PR for: #92 that we aren't applying our Liferay-specific Prettier overrides to TS files. ie. we're not enforcing this: } else { Test plan: Add a ".ts" file, "x.ts" with these contents: if (true) { alert('t'); } else { alert('f'); } Add an "npmscripts.config.js" file (you don't need the ".md" and ".yml" in there, but this is the file I had to create to test the other PR anyway, so I'm just using the same one): module.exports = { check: ['**/*.{md,ts,yml}'], fix: ['**/*.{md,ts,yml}'], } Run `projects/npm-tools/packages/npm-scripts/bin/liferay-npm-scripts.js check` and see the error reported. Run `projects/npm-tools/packages/npm-scripts/bin/liferay-npm-scripts.js fix` and see the code fixed to: if (true) { alert('t'); } else { alert('f'); }
1 parent a77fd31 commit 9b91ba6

File tree

1 file changed

+1
-1
lines changed
  • projects/npm-tools/packages/npm-scripts/src/prettier

1 file changed

+1
-1
lines changed

projects/npm-tools/packages/npm-scripts/src/prettier/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const {SCRIPTLET_CONTENT} = require('../jsp/substituteTags');
2727
const {BLOCK_CLOSE, BLOCK_OPEN} = require('../jsp/tagReplacements');
2828
const {FILLER_CHAR, SPACE_CHAR, TAB_CHAR} = require('../jsp/toFiller');
2929

30-
const EXTENSIONS = new Set(['.js', '.jsp', '.jspf']);
30+
const EXTENSIONS = new Set(['.js', '.jsp', '.jspf', '.ts', '.tsx']);
3131

3232
const linter = new Linter();
3333

0 commit comments

Comments
 (0)