Skip to content

Commit 9f1b772

Browse files
committed
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
1 parent 3986b6e commit 9f1b772

7 files changed

+1986
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@
4242
/Gemfile.lock
4343
/Gemfile.local
4444

45+
/node_modules
46+
yarn-error.log

.hgignore

+2
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ vendor/cache
4141
Gemfile.lock
4242
Gemfile.local
4343

44+
node_modules
45+
yarn-error.log

.stylelintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public/stylesheets/jquery/jquery-ui-*.css

.stylelintrc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"rules": {
3+
"color-no-invalid-hex": true,
4+
"font-family-no-duplicate-names": true,
5+
"font-family-no-missing-generic-family-keyword": true,
6+
"function-calc-no-invalid": true,
7+
"function-calc-no-unspaced-operator": true,
8+
"function-linear-gradient-no-nonstandard-direction": true,
9+
"string-no-newline": true,
10+
"unit-no-unknown": true,
11+
"property-no-unknown": true,
12+
"keyframe-declaration-no-important": true,
13+
"declaration-block-no-duplicate-properties": [true, { ignore: ["consecutive-duplicates-with-different-values"] }],
14+
"declaration-block-no-shorthand-property-overrides": true,
15+
"block-no-empty": true,
16+
"selector-pseudo-class-no-unknown": true,
17+
"selector-pseudo-element-no-unknown": true,
18+
"selector-type-no-unknown": true,
19+
"media-feature-name-no-unknown": true,
20+
"at-rule-no-unknown": true,
21+
"comment-no-empty": true,
22+
"no-duplicate-at-import-rules": true,
23+
"no-duplicate-selectors": true,
24+
"no-empty-source": true,
25+
"no-extra-semicolons": true,
26+
"no-invalid-double-slash-comments": true,
27+
}
28+
}

doc/RUNNING_TESTS

+13
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,16 @@ Checking with RuboCop is recommended when you write patches.
8080

8181
You can run RuboCop with:
8282
`bundle exec rubocop [file ...]`
83+
84+
Running Stylelint, a static code analyzer for CSS files
85+
=======================================
86+
87+
You need to have NodeJS and Yarn installed and available in your PATH:
88+
https://nodejs.org/en/download/package-manager/
89+
https://legacy.yarnpkg.com/lang/en/docs/install/#mac-stable
90+
91+
Install Stylelint:
92+
`yarn install`
93+
94+
You can run Stylelint with:
95+
`node_modules/.bin/stylelint "public/stylesheets/**/*.css"`

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"dependencies": {},
3+
"devDependencies": {
4+
"stylelint": "^13.0.0"
5+
}
6+
}

0 commit comments

Comments
 (0)