You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,24 @@
1
1
# Sass Lint Changelog
2
2
3
+
## v1.12.0
4
+
5
+
**October 3rd, 2017**
6
+
7
+
**Fixes**
8
+
* Fixed an issue with custom properties being flagged in the misspelled-properties rule [#1122](https://github.com/sasstools/sass-lint/pull/1122)
9
+
* Fixed an issue where custom properties with colors in their name would be flagged as invalid by no-color-keywords [#1124](https://github.com/sasstools/sass-lint/pull/1124)
10
+
* Fixed a crash in empty-line-between-blocks where acessing the content of a parent node of type string would throw an error [#1125](https://github.com/sasstools/sass-lint/pull/1125)
11
+
* Functions and custom properties were being incorrectly flagged as invalid within rgba functions for no-color-literals [#1127](https://github.com/sasstools/sass-lint/pull/1127)
12
+
* Fixed an incorrect warning in space-after-colon when using `@at-root`[#1129](https://github.com/sasstools/sass-lint/pull/1129)
13
+
* Fixed an issue where interpolation was incorrectly flagging within the class-name-format rule [#1131](https://github.com/sasstools/sass-lint/pull/1131)
14
+
15
+
16
+
**New Features**
17
+
* Rollup.js integration added to integration list
18
+
* Added an npmignore to remove unnecessary dev files from a sass-lint install / release [#1132](https://github.com/sasstools/sass-lint/pull/1132)
19
+
* Added basic support for a `.sasslintrc` json config file [#1135](https://github.com/sasstools/sass-lint/pull/1135)
20
+
* Added two new options to the variable-for-property rule - [allow-map-get](https://github.com/sasstools/sass-lint/blob/master/docs/rules/variable-for-property.md#allow-map-get-true) & [allowed-functions](https://github.com/sasstools/sass-lint/blob/master/docs/rules/variable-for-property.md#allowed-functions-) - [#1128](https://github.com/sasstools/sass-lint/pull/1128)
Sass-lint can be configured from a `.sass-lint.yml` file in your project. If you don't have one in the root of your project or you would like all your projects to follow a standard config file then you can specify the path to one in your project's `package.json` file.
24
+
Sass-lint can be configured from a `.sass-lint.yml`or `.sasslintrc`file in your project. The `.sasslintrc` file can be in either JSON format or YAML. Both formats are interchangeable easily using tools such as [json2yaml](https://www.json2yaml.com/). If you don't either file in the root of your project or you would like all your projects to follow a standard config file then you can specify the path to one in your project's `package.json` file with the `sasslintConfig` option.
25
25
26
26
For example:
27
27
```javascript
@@ -32,7 +32,7 @@ For example:
32
32
}
33
33
```
34
34
35
-
Use the [Sample Config](https://github.com/sasstools/sass-lint/tree/master/docs/sass-lint.yml) as a guide to create your own`.sass-lint.yml` config file. The default configuration can be found [here](https://github.com/sasstools/sass-lint/blob/master/lib/config/sass-lint.yml).
35
+
Use the [Sample Config (YAML)](https://github.com/sasstools/sass-lint/tree/master/docs/sass-lint.yml)or [Sample Config (JSON)](https://github.com/sasstools/sass-lint/tree/master/docs/sasslintrc)as a guide to create your own config file. The default configuration can be found [here](https://github.com/sasstools/sass-lint/blob/master/lib/config/sass-lint.yml).
@@ -48,7 +48,6 @@ The following are options that you can use to config the Sass Linter.
48
48
*[merge-default-rules](https://github.com/sasstools/sass-lint/tree/master/docs/options/merge-default-rules.md) - Allows you to merge your rules with the default config file included with sass-lint
49
49
*[output-file](https://github.com/sasstools/sass-lint/tree/master/docs/options/output-file.md) - Choose to write the linters output to a file
50
50
51
-
52
51
#### Files
53
52
54
53
The `files` option contains two properties, `include` and `ignore`. Both can be set to either a [glob](https://github.com/isaacs/node-glob) or an array of glob strings/file paths depending on your projects' needs and setup.
@@ -284,6 +283,10 @@ Our AST is [Gonzales-PE](https://github.com/tonyganch/gonzales-pe/tree/dev). Eac
Copy file name to clipboardExpand all lines: docs/rules/variable-for-property.md
+95Lines changed: 95 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,10 @@ The `!important` flag will also be excluded when used.
14
14
15
15
*`properties`: `[array of property names]` (defaults to empty array `[]`)
16
16
17
+
*`allow-map-get`: `true`/`false` (defaults to `true`) You may allow/disallow the use of `map-get()` as property values
18
+
19
+
*`allowed-functions`: `[array of function names]` (defaults to empty array `[]`)
20
+
17
21
You may pass an array of properties you wish to enforce the use of variables for
18
22
19
23
```yaml
@@ -26,10 +30,54 @@ variable-for-property:
26
30
- 'content'
27
31
```
28
32
33
+
You may pass an array of function names you wish to allow as property values
34
+
35
+
```yaml
36
+
37
+
variable-for-property:
38
+
- 1
39
+
-
40
+
'allowed-functions':
41
+
- 'my-map-func'
42
+
- 'palette'
43
+
```
44
+
45
+
*** full config example ***
46
+
47
+
```yaml
48
+
variable-for-property:
49
+
- 1
50
+
-
51
+
allow-map-get: true
52
+
allowed-functions:
53
+
- my-map-func
54
+
- palette
55
+
properties:
56
+
- margin
57
+
- content
58
+
```
59
+
29
60
## Examples
30
61
31
62
By default `properties` is an empty array and therefore no properties are forced to use variables as values.
32
63
64
+
```scss
65
+
.bar {
66
+
content: ' ';
67
+
margin: 0;
68
+
69
+
&__element {
70
+
margin: 0;
71
+
}
72
+
}
73
+
74
+
@mixin red() {
75
+
margin: 0;
76
+
}
77
+
```
78
+
79
+
## [properties: []]
80
+
33
81
When `properties` contains the values shown in the options section example the following would be disallowed:
34
82
35
83
```scss
@@ -65,6 +113,53 @@ When `properties` contains the values shown in the options section example the f
65
113
66
114
```
67
115
116
+
## [allow-map-get: true]
117
+
118
+
When allow-map-get is set to `true` and properties contains the `color` property, the following would be allowed
119
+
120
+
```scss
121
+
.foo {
122
+
color: map-get(blueish, light);
123
+
}
124
+
```
125
+
126
+
When allow-map-get is set to `false` and properties contains the `color` property, the following would be disallowed
127
+
128
+
```scss
129
+
.foo {
130
+
color: map-get(blueish, light);
131
+
}
132
+
```
133
+
134
+
## [allowed-functions: []]
135
+
136
+
When `allowed-functions` contains the values shown in the options section and `properties` includes the `color` property the following would be disallowed:
137
+
138
+
```scss
139
+
.foo {
140
+
color: disallowed-function($test, $vars);
141
+
142
+
&__element {
143
+
color: invalid-func-name($test, $vars);
144
+
}
145
+
}
146
+
```
147
+
148
+
When `allowed-functions` contains the values shown in the options section and `properties` includes the `color` property the following would be disallowed:
149
+
150
+
```scss
151
+
.foo {
152
+
color: my-map-func($allowed);
153
+
154
+
&__element {
155
+
color: palette(blue, light);
156
+
}
157
+
}
158
+
159
+
```
160
+
161
+
## Extra info
162
+
68
163
The `!important` flag will be excluded from any lint warnings.
69
164
70
165
For example if `properties` contains the value `color` the following would be disallowed
0 commit comments