Skip to content

Commit 9e81fd4

Browse files
Merge pull request #1151 from bryceosterhaus/cssSupport
fix(npm-scripts): support formatting css files
2 parents aa90546 + 1aa8919 commit 9e81fd4

File tree

7 files changed

+12
-5
lines changed

7 files changed

+12
-5
lines changed

.github/workflows/projects.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222

2323
env:
2424
CI: true
25-
yarn-cache-name: yarn-cache-11
25+
yarn-cache-name: yarn-cache-20
2626
yarn-cache-path: .yarn
2727

2828
jobs:

projects/npm-tools/packages/npm-scripts/src/config/npmscripts.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const path = require('path');
88
const CHECK_AND_FIX_GLOBS = [
99
'**/*.{html,js,jsx,css,scss,ts,tsx}',
1010
'/*.{js,ts}',
11-
'/{dev,extra,src,test}/**/*.{js,scss,ts,tsx}',
11+
'/{dev,extra,src,test}/**/*.{html,js,jsx,css,scss,ts,tsx}',
1212
'/src/**/*.{jsp,jspf}',
1313
];
1414

projects/npm-tools/packages/npm-scripts/src/config/stylelint.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@
5151
}
5252
],
5353
"selector-pseudo-class-no-unknown": true,
54-
"selector-pseudo-element-no-unknown": true,
54+
"selector-pseudo-element-no-unknown": [
55+
true,
56+
{
57+
"ignorePseudoElements": ["ng-deep"]
58+
}
59+
],
5560
"selector-type-no-unknown": true,
5661
"shorthand-property-no-redundant-values": true,
5762
"unit-case": "lower",

projects/npm-tools/packages/npm-scripts/src/scripts/format.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const DEFAULT_OPTIONS = {
2222
* File extensions that we allow Prettier to process.
2323
*/
2424
const EXTENSIONS = [
25+
'.css',
2526
'.js',
2627
'.json',
2728
'.jsp',

projects/npm-tools/packages/npm-scripts/src/scripts/lint.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const DEFAULT_OPTIONS = {
3232
* - via stylelint (natively).
3333
*/
3434
const EXTENSIONS = {
35+
css: ['.css'],
3536
js: ['.js', '.ts', '.tsx'],
3637
jsp: ['.jsp', '.jspf'],
3738
scss: ['.scss'],

projects/npm-tools/packages/npm-scripts/src/scripts/lint/stylelint/isSCSS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
const hasExtension = require('../../../utils/hasExtension');
77

8-
const EXTENSIONS = new Set(['.scss']);
8+
const EXTENSIONS = new Set(['.css', '.scss']);
99

1010
function isSCSS(filePath) {
1111
return hasExtension(filePath, EXTENSIONS);

projects/npm-tools/packages/npm-scripts/src/scripts/lint/stylelint/lintSCSS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async function lintSCSS(source, onReport, options = {}) {
4848

4949
fix,
5050

51-
syntax: 'scss',
51+
syntax: path.extname(filePath).replace('.', ''),
5252
});
5353

5454
results.forEach((result) => {

0 commit comments

Comments
 (0)