Skip to content

Commit

Permalink
Merge pull request #1151 from bryceosterhaus/cssSupport
Browse files Browse the repository at this point in the history
fix(npm-scripts): support formatting css files
  • Loading branch information
bryceosterhaus authored Jul 18, 2023
2 parents aa90546 + 1aa8919 commit 9e81fd4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:

env:
CI: true
yarn-cache-name: yarn-cache-11
yarn-cache-name: yarn-cache-20
yarn-cache-path: .yarn

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const path = require('path');
const CHECK_AND_FIX_GLOBS = [
'**/*.{html,js,jsx,css,scss,ts,tsx}',
'/*.{js,ts}',
'/{dev,extra,src,test}/**/*.{js,scss,ts,tsx}',
'/{dev,extra,src,test}/**/*.{html,js,jsx,css,scss,ts,tsx}',
'/src/**/*.{jsp,jspf}',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@
}
],
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-no-unknown": true,
"selector-pseudo-element-no-unknown": [
true,
{
"ignorePseudoElements": ["ng-deep"]
}
],
"selector-type-no-unknown": true,
"shorthand-property-no-redundant-values": true,
"unit-case": "lower",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const DEFAULT_OPTIONS = {
* File extensions that we allow Prettier to process.
*/
const EXTENSIONS = [
'.css',
'.js',
'.json',
'.jsp',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const DEFAULT_OPTIONS = {
* - via stylelint (natively).
*/
const EXTENSIONS = {
css: ['.css'],
js: ['.js', '.ts', '.tsx'],
jsp: ['.jsp', '.jspf'],
scss: ['.scss'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

const EXTENSIONS = new Set(['.scss']);
const EXTENSIONS = new Set(['.css', '.scss']);

function isSCSS(filePath) {
return hasExtension(filePath, EXTENSIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function lintSCSS(source, onReport, options = {}) {

fix,

syntax: 'scss',
syntax: path.extname(filePath).replace('.', ''),
});

results.forEach((result) => {
Expand Down

0 comments on commit 9e81fd4

Please sign in to comment.