Skip to content

Commit

Permalink
Ajout d'une configuration pour stylelint (#323)
Browse files Browse the repository at this point in the history
* Add stylelint configuration and update CI for style linting

* fix style lint errors

* rebase + lint fix

---------

Co-authored-by: David FYON <davidfyon@gmail.com>
  • Loading branch information
4dr1en and DavidFyon authored Jan 8, 2025
1 parent c4396bd commit 354e0ed
Show file tree
Hide file tree
Showing 48 changed files with 1,812 additions and 1,186 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Lint (show only errors)
run: pnpm lint --quiet
working-directory: ./
- name: Lint style (show only errors)
run: pnpm lint:style --quiet
working-directory: ./
- name: Unit tests without Snapshots
run: pnpm test:unit
- name: Build
Expand Down
19 changes: 19 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": [
"stylelint-config-standard-scss",
"stylelint-config-recommended-vue/scss",
"@stylistic/stylelint-config"
],
"rules": {
"no-empty-source": null,
"no-descending-specificity": null,
"selector-class-pattern": [
"^([a-z0-9]+(?:-[a-z0-9]+)*)(__([a-z0-9]+(?:-[a-z0-9]+)*))?(--([a-z0-9]+(?:-[a-z0-9]+)*))?$",
{ "severity": "warning" }
],
"max-nesting-depth": 5,
"selector-max-compound-selectors": 8,
"@stylistic/indentation": "tab",
"@stylistic/string-quotes": "single"
}
}
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"lint": "eslint 'src/**/*.{ts,js,vue}'",
"lint:fix": "eslint 'src/**/*.{ts,js,vue}' --fix",
"lint:style": "stylelint 'src/**/*.{css,scss,vue}'",
"lint:fix": "eslint 'src/**/*.{ts,js,vue}' --fix && stylelint 'src/**/*.{css,scss,vue}' --fix",
"test:unit": "vitest run",
"prepare": "husky",
"generate:changelog": "auto-changelog -o CHANGELOG-TEMP.md -p --starting-date 2024-10-10"
Expand Down Expand Up @@ -62,6 +63,7 @@
"@storybook/vue3-vite": "^8.4.7",
"@stylistic/eslint-plugin": "^2.9.0",
"@stylistic/eslint-plugin-ts": "^2.9.0",
"@stylistic/stylelint-config": "^2.0.0",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^20.17.1",
"@typescript-eslint/parser": "^8.11.0",
Expand All @@ -77,9 +79,15 @@
"eslint-plugin-vuejs-accessibility": "^2.4.1",
"happy-dom": "^15.7.4",
"husky": "^9.1.6",
"postcss-html": "^1.7.0",
"postcss-scss": "^4.0.9",
"resize-observer-polyfill": "^1.5.1",
"storybook": "^8.4.7",
"storybook-addon-vue-mdx": "^1.0.4",
"stylelint": "^16.12.0",
"stylelint-config-recommended-scss": "^14.1.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^14.0.0",
"typescript": "5.4.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
Expand Down
Loading

0 comments on commit 354e0ed

Please sign in to comment.