@pi-r/stylelint 0.9.3 → 0.10.0
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/index.js +10 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -5,7 +5,16 @@ async function transform(context, value, options) {
|
|
|
5
5
|
const { pathname, filename } = options;
|
|
6
6
|
const baseConfig = options.toBaseConfig();
|
|
7
7
|
const timeStamp = Date.now();
|
|
8
|
-
const report = await context.lint(
|
|
8
|
+
const report = await context.lint('config' in baseConfig ? (baseConfig.code = value, baseConfig) : {
|
|
9
|
+
code: value,
|
|
10
|
+
config: Object.keys(baseConfig).length > 0 ? baseConfig : undefined,
|
|
11
|
+
cwd: process.env.STYLELINT_OPTIONS_CWD,
|
|
12
|
+
configFile: process.env.STYLELINT_OPTIONS_CONFIG_FILE,
|
|
13
|
+
configBasedir: process.env.STYLELINT_OPTIONS_CONFIG_BASEDIR,
|
|
14
|
+
validate: baseConfig.validate ?? process.env.STYLELINT_OPTIONS_VALIDATE === 'true',
|
|
15
|
+
fix: baseConfig.fix ?? process.env.STYLELINT_OPTIONS_FIX === 'true',
|
|
16
|
+
formatter: baseConfig.formatter ?? process.env.STYLELINT_OPTIONS_FORMATTER
|
|
17
|
+
});
|
|
9
18
|
const result = report.results[0];
|
|
10
19
|
if (result?.warnings.length) {
|
|
11
20
|
options.out[Document.hasLogType(options.logType.STDOUT) ? 'logQueued' : 'logAppend'] = Document.generateLintTable(result.warnings.map(item => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/stylelint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Stylelint transform function for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@e-mc/document": "^0.
|
|
23
|
-
"stylelint": "^16.
|
|
24
|
-
"stylelint-config-standard": "^
|
|
22
|
+
"@e-mc/document": "^0.12.0",
|
|
23
|
+
"stylelint": "^16.19.1",
|
|
24
|
+
"stylelint-config-standard": "^38.0.0"
|
|
25
25
|
}
|
|
26
26
|
}
|