Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(npm-scripts): support formatting css files #1151

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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