From e4531c46aaae4d3d27d4f1d2ecc4e8baab373730 Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Sun, 11 Aug 2024 05:20:46 +0300 Subject: [PATCH] fix: Fix Windows specific --- bin/lint | 6 ++++-- eslint-common-config.js | 7 ++++++- test/test.sh | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/lint b/bin/lint index 242c713..540a82b 100755 --- a/bin/lint +++ b/bin/lint @@ -22,7 +22,7 @@ done if [[ -n "$INIT$UPDATE" ]]; then echo "[@diplodoc/lint] Add initial lint configs" - cp -r "$SRCDIR/scaffolding/" . + cp -a "$SRCDIR/scaffolding/." . echo "[@diplodoc/lint] Extend .ignore configuration" node "$SRCDIR/scripts/modify-ignore.js" @@ -46,7 +46,9 @@ if [[ -n $FIX ]]; then $BINDIR/eslint '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}' --fix $BINDIR/prettier --write '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}' - $BINDIR/stylelint '**/*.{css,scss}' --fix + if [[ -n $(find . -type f -name '*.css' -name '*.scss' | grep -vwFf .stylelintignore) ]]; then + $BINDIR/stylelint '**/*.{css,scss}' --fix + fi exit 0 fi diff --git a/eslint-common-config.js b/eslint-common-config.js index 1744d83..fb74ebd 100644 --- a/eslint-common-config.js +++ b/eslint-common-config.js @@ -5,7 +5,12 @@ module.exports = { process.env.npm_command && '@gravity-ui/eslint-config/prettier', ].filter(Boolean), overrides: [{ - files: ['.eslintrc.js'], + files: [ + '.eslintrc.js', + '.prettierrc.js', + '.stylelintrc.js', + '.lintstagedrc.js', + ], env: { node: true, }, diff --git a/test/test.sh b/test/test.sh index b4ec026..9ad8edf 100755 --- a/test/test.sh +++ b/test/test.sh @@ -4,4 +4,4 @@ set -e npm i @diplodoc/lint npx @diplodoc/lint init -npm run lint \ No newline at end of file +npm run lint:fix \ No newline at end of file