@bhsd/stylelint-browserify 16.19.1-es7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +69 -0
- package/bundle/stylelint-es7.min.js +52 -0
- package/bundle/stylelint-es7.min.js.map +7 -0
- package/bundle/stylelint.js.LEGAL.txt +12 -0
- package/bundle/stylelint.min.js +52 -0
- package/bundle/stylelint.min.js.map +7 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bhsd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Stylelint-browserify
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@bhsd/stylelint-browserify)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://app.codacy.com/gh/bhsd-harry/stylelint-browserify/dashboard)
|
|
6
|
+
|
|
7
|
+
# API
|
|
8
|
+
|
|
9
|
+
The `stylelint` global variable has a `lint()` method.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
const result = await stylelint.lint(options);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
### `config`
|
|
18
|
+
|
|
19
|
+
A [configuration object](https://stylelint.io/user-guide/configure).
|
|
20
|
+
|
|
21
|
+
### `code`
|
|
22
|
+
|
|
23
|
+
A string to lint.
|
|
24
|
+
|
|
25
|
+
## The returned promise
|
|
26
|
+
|
|
27
|
+
`stylelint.lint()` returns a `Promise` that resolves with an object containing the following properties:
|
|
28
|
+
|
|
29
|
+
### `code`
|
|
30
|
+
|
|
31
|
+
A string that contains the autofixed code, if the `fix` option is set to `true`. Otherwise, it is `undefined`.
|
|
32
|
+
|
|
33
|
+
### `errored`
|
|
34
|
+
|
|
35
|
+
Boolean. If `true`, at least one rule with an "error"-level severity registered a problem.
|
|
36
|
+
|
|
37
|
+
### `report`
|
|
38
|
+
|
|
39
|
+
A JSON string that contains the formatted problems.
|
|
40
|
+
|
|
41
|
+
### `results`
|
|
42
|
+
|
|
43
|
+
An array containing all the Stylelint result objects (the objects that formatters consume).
|
|
44
|
+
|
|
45
|
+
### Edit info
|
|
46
|
+
|
|
47
|
+
When the [`computeEditInfo` option](https://stylelint.io/user-guide/options#computeeditinfo) is enabled, a warning may include a `fix` property that provides information about suggested fixes:
|
|
48
|
+
|
|
49
|
+
- `range` (`[number, number]`) - the pair of 0-based indices in source code text to remove
|
|
50
|
+
- `text` (`string`) - the text to add
|
|
51
|
+
|
|
52
|
+
For example, to change `a { opacity: 10%; }` to `a { opacity: 0.1; }`, the `EditInfo` might look like:
|
|
53
|
+
|
|
54
|
+
```jsonc
|
|
55
|
+
{
|
|
56
|
+
// "line", "column", "rule", ...
|
|
57
|
+
"fix": {
|
|
58
|
+
"range": [13, 16], // Indices of "10%"
|
|
59
|
+
"text": "0.1" // Replacement text
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Only a single `EditInfo` will be recorded for a specific region in source code. If multiple report ranges overlap, only the first will contain `EditInfo`.
|
|
65
|
+
|
|
66
|
+
## Syntax errors
|
|
67
|
+
|
|
68
|
+
`stylelint.lint()` does not reject the `Promise` when your CSS contains syntax errors.
|
|
69
|
+
It resolves with an object (see [the returned promise](#the-returned-promise)) that contains information about the syntax error.
|