@salesforce-ux/slds-linter 1.0.5 → 1.0.6
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/build/index.js
CHANGED
|
@@ -19,7 +19,7 @@ process.on("uncaughtException", (error) => {
|
|
|
19
19
|
var program = new Command();
|
|
20
20
|
program.name("npx @salesforce-ux/slds-linter@latest").showHelpAfterError();
|
|
21
21
|
function registerVersion() {
|
|
22
|
-
program.description("SLDS Linter CLI tool for linting styles and components").version("1.0.
|
|
22
|
+
program.description("SLDS Linter CLI tool for linting styles and components").version("1.0.6");
|
|
23
23
|
}
|
|
24
24
|
registerLintCommand(program);
|
|
25
25
|
registerReportCommand(program);
|
|
@@ -34,7 +34,8 @@ var ConfigLoader = class {
|
|
|
34
34
|
const userConfigUrl = pathToFileURL(absolutePath).href;
|
|
35
35
|
const pluginInstalled = this.isPackageInstalled("@salesforce-ux/eslint-plugin-slds", userConfigUrl);
|
|
36
36
|
const eslintInstalled = this.isPackageInstalled("eslint", userConfigUrl);
|
|
37
|
-
|
|
37
|
+
const cssPluginInstalled = this.isPackageInstalled("@eslint/css", userConfigUrl);
|
|
38
|
+
if (pluginInstalled && eslintInstalled && cssPluginInstalled) {
|
|
38
39
|
Logger.debug("Dependencies already installed, using config as-is");
|
|
39
40
|
return platform() === "win32" ? userConfigUrl : absolutePath;
|
|
40
41
|
}
|
|
@@ -43,14 +44,21 @@ var ConfigLoader = class {
|
|
|
43
44
|
const require2 = createRequire(import.meta.url);
|
|
44
45
|
const pluginPath = require2.resolve("@salesforce-ux/eslint-plugin-slds");
|
|
45
46
|
const eslintConfigPath = require2.resolve("eslint/config");
|
|
47
|
+
const cssCjsPath = require2.resolve("@eslint/css");
|
|
48
|
+
const cssPackageDir = resolve(cssCjsPath, "../../..");
|
|
49
|
+
const cssPluginPath = join(cssPackageDir, "dist/esm/index.js");
|
|
46
50
|
const pluginImport = platform() === "win32" ? pathToFileURL(pluginPath).href : pluginPath;
|
|
47
51
|
const eslintConfigImport = platform() === "win32" ? pathToFileURL(eslintConfigPath).href : eslintConfigPath;
|
|
52
|
+
const cssPluginImport = platform() === "win32" ? pathToFileURL(cssPluginPath).href : cssPluginPath;
|
|
48
53
|
const rewritten = configContent.replace(
|
|
49
54
|
/import\s+(\w+)\s+from\s+['"]@salesforce-ux\/eslint-plugin-slds['"]/g,
|
|
50
55
|
`import $1 from '${pluginImport}'`
|
|
51
56
|
).replace(
|
|
52
57
|
/import\s+({[^}]+})\s+from\s+['"]eslint\/config['"]/g,
|
|
53
58
|
`import $1 from '${eslintConfigImport}'`
|
|
59
|
+
).replace(
|
|
60
|
+
/import\s+(\w+)\s+from\s+['"]@eslint\/css['"]/g,
|
|
61
|
+
`import $1 from '${cssPluginImport}'`
|
|
54
62
|
);
|
|
55
63
|
const tempPath = join(tmpdir(), `slds-config-${Date.now()}.mjs`);
|
|
56
64
|
await writeFile(tempPath, rewritten, "utf-8");
|
|
@@ -157,7 +157,7 @@ var rule_messages_default = {
|
|
|
157
157
|
// src/services/config.resolver.ts
|
|
158
158
|
var DEFAULT_ESLINT_CONFIG_PATH = resolvePath("@salesforce-ux/eslint-plugin-slds/config", import.meta);
|
|
159
159
|
var ESLINT_VERSION = "9.36.0";
|
|
160
|
-
var LINTER_CLI_VERSION = "1.0.
|
|
160
|
+
var LINTER_CLI_VERSION = "1.0.6";
|
|
161
161
|
var getRuleDescription = (ruleId) => {
|
|
162
162
|
const ruleIdWithoutNameSpace = `${ruleId}`.replace(/\@salesforce-ux\//, "").replace(/^slds\//, "");
|
|
163
163
|
return rule_messages_default[ruleIdWithoutNameSpace]?.description || "--";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce-ux/slds-linter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "SLDS Linter CLI tool for linting styles and components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lightning design system linter",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"bin": "build/index.js",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@salesforce-ux/eslint-plugin-slds": "1.0.
|
|
32
|
+
"@salesforce-ux/eslint-plugin-slds": "1.0.6",
|
|
33
33
|
"@typescript-eslint/eslint-plugin": "^8.36.0",
|
|
34
34
|
"@typescript-eslint/parser": "^8.36.0",
|
|
35
35
|
"chalk": "^4.1.2",
|