@discourse/lint-configs 2.34.1 → 2.35.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.
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const MATCHER =
|
|
2
|
+
/^(admin\/|float-kit\/|select-kit\/|truth-helpers|dialog-holder\/)/;
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
meta: {
|
|
6
|
+
type: "suggestion",
|
|
7
|
+
docs: {
|
|
8
|
+
description: "Use the updated import paths",
|
|
9
|
+
},
|
|
10
|
+
fixable: "code",
|
|
11
|
+
schema: [], // no options
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
create(context) {
|
|
15
|
+
return {
|
|
16
|
+
ImportDeclaration(node) {
|
|
17
|
+
if (MATCHER.test(node.source.value)) {
|
|
18
|
+
const correctedValue = `discourse/${node.source.value}`;
|
|
19
|
+
context.report({
|
|
20
|
+
node,
|
|
21
|
+
message: `Use '${correctedValue}' instead of '${node.source.value}'`,
|
|
22
|
+
fix(fixer) {
|
|
23
|
+
return fixer.replaceText(node.source, `"${correctedValue}"`);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
};
|
package/eslint.mjs
CHANGED
|
@@ -22,6 +22,7 @@ import i18nT from "./eslint-rules/i18n-t.mjs";
|
|
|
22
22
|
import lineAfterImports from "./eslint-rules/line-after-imports.mjs";
|
|
23
23
|
import lineBeforeDefaultExport from "./eslint-rules/line-before-default-export.mjs";
|
|
24
24
|
import linesBetweenClassMembers from "./eslint-rules/lines-between-class-members.mjs";
|
|
25
|
+
import movedPackagesImportPaths from "./eslint-rules/moved-packages-import-paths.mjs";
|
|
25
26
|
import noCurlyComponents from "./eslint-rules/no-curly-components.mjs";
|
|
26
27
|
import noOnclick from "./eslint-rules/no-onclick.mjs";
|
|
27
28
|
import noRouteTemplate from "./eslint-rules/no-route-template.mjs";
|
|
@@ -140,6 +141,7 @@ export default [
|
|
|
140
141
|
"no-onclick": noOnclick,
|
|
141
142
|
"no-route-template": noRouteTemplate,
|
|
142
143
|
"template-tag-no-self-this": templateTagNoSelfThis,
|
|
144
|
+
"moved-packages-import-paths": movedPackagesImportPaths,
|
|
143
145
|
},
|
|
144
146
|
},
|
|
145
147
|
},
|
|
@@ -318,6 +320,7 @@ export default [
|
|
|
318
320
|
"discourse/no-onclick": ["error"],
|
|
319
321
|
"discourse/template-tag-no-self-this": ["error"],
|
|
320
322
|
// "discourse/no-route-template": ["error"], // Enable by default once Ember 6.6 is on stable
|
|
323
|
+
// "discourse/moved-packages-import-paths": ["error"], // Enable when the package move commits are released
|
|
321
324
|
},
|
|
322
325
|
},
|
|
323
326
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@discourse/lint-configs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.35.0",
|
|
4
4
|
"description": "Shareable lint configs for Discourse core, plugins, and themes",
|
|
5
5
|
"author": "Discourse",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,10 +28,6 @@
|
|
|
28
28
|
},
|
|
29
29
|
"./template-lint-rules": "./template-lint-rules/index.mjs"
|
|
30
30
|
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"lint": "eslint --no-error-on-unmatched-pattern \"**/*.{cjs,mjs,js}\" && pnpm prettier --check \"**/*.{cjs,mjs,js}\"",
|
|
33
|
-
"test": "cd ../test && node test.js"
|
|
34
|
-
},
|
|
35
31
|
"dependencies": {
|
|
36
32
|
"@babel/core": "^7.28.4",
|
|
37
33
|
"@babel/eslint-parser": "^7.28.0",
|
|
@@ -58,5 +54,9 @@
|
|
|
58
54
|
"eslint": "9.36.0",
|
|
59
55
|
"prettier": "3.6.2",
|
|
60
56
|
"stylelint": "16.24.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"lint": "eslint --no-error-on-unmatched-pattern \"**/*.{cjs,mjs,js}\" && pnpm prettier --check \"**/*.{cjs,mjs,js}\"",
|
|
60
|
+
"test": "cd ../test && node test.js"
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|