mirror of
https://github.com/redmine/redmine.git
synced 2025-11-01 19:05:51 +01:00
Adds Stylelint to lint CSS files (#32888).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19732 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -42,3 +42,5 @@
|
|||||||
/Gemfile.lock
|
/Gemfile.lock
|
||||||
/Gemfile.local
|
/Gemfile.local
|
||||||
|
|
||||||
|
/node_modules
|
||||||
|
yarn-error.log
|
||||||
|
|||||||
@@ -41,3 +41,5 @@ vendor/cache
|
|||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
Gemfile.local
|
Gemfile.local
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
yarn-error.log
|
||||||
|
|||||||
1
.stylelintignore
Normal file
1
.stylelintignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
public/stylesheets/jquery/jquery-ui-*.css
|
||||||
28
.stylelintrc
Normal file
28
.stylelintrc
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"color-no-invalid-hex": true,
|
||||||
|
"font-family-no-duplicate-names": true,
|
||||||
|
"font-family-no-missing-generic-family-keyword": true,
|
||||||
|
"function-calc-no-invalid": true,
|
||||||
|
"function-calc-no-unspaced-operator": true,
|
||||||
|
"function-linear-gradient-no-nonstandard-direction": true,
|
||||||
|
"string-no-newline": true,
|
||||||
|
"unit-no-unknown": true,
|
||||||
|
"property-no-unknown": true,
|
||||||
|
"keyframe-declaration-no-important": true,
|
||||||
|
"declaration-block-no-duplicate-properties": [true, { ignore: ["consecutive-duplicates-with-different-values"] }],
|
||||||
|
"declaration-block-no-shorthand-property-overrides": true,
|
||||||
|
"block-no-empty": true,
|
||||||
|
"selector-pseudo-class-no-unknown": true,
|
||||||
|
"selector-pseudo-element-no-unknown": true,
|
||||||
|
"selector-type-no-unknown": true,
|
||||||
|
"media-feature-name-no-unknown": true,
|
||||||
|
"at-rule-no-unknown": true,
|
||||||
|
"comment-no-empty": true,
|
||||||
|
"no-duplicate-at-import-rules": true,
|
||||||
|
"no-duplicate-selectors": true,
|
||||||
|
"no-empty-source": true,
|
||||||
|
"no-extra-semicolons": true,
|
||||||
|
"no-invalid-double-slash-comments": true,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -80,3 +80,16 @@ Checking with RuboCop is recommended when you write patches.
|
|||||||
|
|
||||||
You can run RuboCop with:
|
You can run RuboCop with:
|
||||||
`bundle exec rubocop [file ...]`
|
`bundle exec rubocop [file ...]`
|
||||||
|
|
||||||
|
Running Stylelint, a static code analyzer for CSS files
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
You need to have NodeJS and Yarn installed and available in your PATH:
|
||||||
|
https://nodejs.org/en/download/package-manager/
|
||||||
|
https://legacy.yarnpkg.com/lang/en/docs/install/#mac-stable
|
||||||
|
|
||||||
|
Install Stylelint:
|
||||||
|
`yarn install`
|
||||||
|
|
||||||
|
You can run Stylelint with:
|
||||||
|
`node_modules/.bin/stylelint "public/stylesheets/**/*.css"`
|
||||||
|
|||||||
6
package.json
Normal file
6
package.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"stylelint": "^13.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user