Skip to content

Commit

Permalink
Merge pull request #979 from Choices-js/npm-audit-fix
Browse files Browse the repository at this point in the history
Switch to dart-sass, fix npm audit issues, add stylelint
  • Loading branch information
mtriff authored Dec 19, 2021
2 parents 59ea75e + fb37940 commit c4f3a81
Show file tree
Hide file tree
Showing 16 changed files with 5,901 additions and 21,579 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ jobs:
node-version: 12

- name: Install dependencies
run: npm install --no-optional --no-audit --ignore-scripts
run: npm ci
env:
CYPRESS_INSTALL_BINARY: 0
HUSKY_SKIP_INSTALL: true

- name: run eslint
run: |
CHANGED_TS=$(git --no-pager diff --name-only ..origin/master | grep '^src\/scripts\/.*\.ts$' | xargs ls -d 2>/dev/null | paste -sd " " -)
if [[ -z $(sed -e 's/[[:space:]]*$//' <<<${CHANGED_TS}) ]]; then CHANGED_TS="src/scripts"; fi
echo $CHANGED_TS
node node_modules/eslint/bin/eslint.js $CHANGED_TS
run: npm run lint:js

## Can't use same eslint config for TypeScript and JavaScript
## TypeScript rules cause rule definition not found errors
Expand All @@ -39,3 +35,6 @@ jobs:
# run: |
# npm run js:build
# npx eslint --no-ignore ./public/assets/scripts/*.js

- name: run stylelint
run: npm run lint:scss
6 changes: 6 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"declaration-block-no-redundant-longhand-properties": null
}
}
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,11 @@
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"stylelint.validate": [
"css",
"less",
"postcss",
"scss"
]
}
Loading

0 comments on commit c4f3a81

Please sign in to comment.