@discourse/lint-configs 2.17.2 → 2.19.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
|
+
export default {
|
|
2
|
+
meta: {
|
|
3
|
+
type: "problem",
|
|
4
|
+
docs: {
|
|
5
|
+
description: "disallow api.registerConnectorClass() uses",
|
|
6
|
+
},
|
|
7
|
+
fixable: "code",
|
|
8
|
+
schema: [], // no options
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
create(context) {
|
|
12
|
+
return {
|
|
13
|
+
CallExpression(node) {
|
|
14
|
+
const { callee, arguments: args } = node;
|
|
15
|
+
|
|
16
|
+
if (
|
|
17
|
+
callee.type === "MemberExpression" &&
|
|
18
|
+
callee.property.name === "registerConnectorClass" &&
|
|
19
|
+
args.length === 3
|
|
20
|
+
) {
|
|
21
|
+
context.report({
|
|
22
|
+
node,
|
|
23
|
+
message:
|
|
24
|
+
"registerConnectorClass is deprecated. Create a glimmer component in a plugin connector directory or use renderInOutlet instead.",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
};
|
package/eslint.mjs
CHANGED
|
@@ -19,6 +19,7 @@ import i18nT from "./eslint-rules/i18n-t.mjs";
|
|
|
19
19
|
import lineAfterImports from "./eslint-rules/line-after-imports.mjs";
|
|
20
20
|
import lineBeforeDefaultExport from "./eslint-rules/line-before-default-export.mjs";
|
|
21
21
|
import linesBetweenClassMembers from "./eslint-rules/lines-between-class-members.mjs";
|
|
22
|
+
import noRegisterConnectorClass from "./eslint-rules/no-register-connector-class.mjs";
|
|
22
23
|
import noSimpleQuerySelector from "./eslint-rules/no-simple-query-selector.mjs";
|
|
23
24
|
import serviceInjectImport from "./eslint-rules/service-inject-import.mjs";
|
|
24
25
|
import truthHelpersImports from "./eslint-rules/truth-helpers-imports.mjs";
|
|
@@ -118,6 +119,7 @@ export default [
|
|
|
118
119
|
"deprecated-lookups": deprecatedLookups,
|
|
119
120
|
"discourse-common-imports": discourseCommonImports,
|
|
120
121
|
"lines-between-class-members": linesBetweenClassMembers,
|
|
122
|
+
"no-register-connector-class": noRegisterConnectorClass,
|
|
121
123
|
"line-after-imports": lineAfterImports,
|
|
122
124
|
"line-before-default-export": lineBeforeDefaultExport,
|
|
123
125
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@discourse/lint-configs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "Shareable lint configs for Discourse core, plugins, and themes",
|
|
5
5
|
"author": "Discourse",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,26 +33,26 @@
|
|
|
33
33
|
"@babel/core": "^7.27.1",
|
|
34
34
|
"@babel/eslint-parser": "^7.27.1",
|
|
35
35
|
"@babel/plugin-proposal-decorators": "^7.27.1",
|
|
36
|
-
"ember-template-lint": "^7.
|
|
37
|
-
"eslint": "^9.
|
|
36
|
+
"ember-template-lint": "^7.7.0",
|
|
37
|
+
"eslint": "^9.27.0",
|
|
38
38
|
"eslint-plugin-decorator-position": "^6.0.0",
|
|
39
39
|
"eslint-plugin-ember": "^12.5.0",
|
|
40
40
|
"eslint-plugin-import": "^2.31.0",
|
|
41
41
|
"eslint-plugin-qunit": "^8.1.2",
|
|
42
42
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
43
43
|
"eslint-plugin-sort-class-members": "^1.21.0",
|
|
44
|
-
"globals": "^16.
|
|
44
|
+
"globals": "^16.1.0",
|
|
45
45
|
"prettier": "^3.5.3",
|
|
46
46
|
"prettier-plugin-ember-template-tag": "^2.0.5",
|
|
47
47
|
"stylelint": "^16.19.1",
|
|
48
48
|
"stylelint-config-standard": "^38.0.0",
|
|
49
|
-
"stylelint-config-standard-scss": "^
|
|
49
|
+
"stylelint-config-standard-scss": "^15.0.1",
|
|
50
50
|
"stylelint-scss": "^6.12.0",
|
|
51
51
|
"typescript": "^5.8.3"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"ember-template-lint": "7.
|
|
55
|
-
"eslint": "9.
|
|
54
|
+
"ember-template-lint": "7.7.0",
|
|
55
|
+
"eslint": "9.27.0",
|
|
56
56
|
"prettier": "3.5.3",
|
|
57
57
|
"stylelint": "16.19.1"
|
|
58
58
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import NoAtClass from "./no-at-class.mjs";
|
|
2
2
|
import NoImplicitThis from "./no-implicit-this.mjs";
|
|
3
|
+
import PluginOutletLazyHash from "./plugin-outlet-lazy-hash.mjs";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
// Name of plugin
|
|
@@ -9,5 +10,6 @@ export default {
|
|
|
9
10
|
rules: {
|
|
10
11
|
"discourse/no-at-class": NoAtClass,
|
|
11
12
|
"discourse/no-implicit-this": NoImplicitThis,
|
|
13
|
+
"discourse/plugin-outlet-lazy-hash": PluginOutletLazyHash,
|
|
12
14
|
},
|
|
13
15
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Rule } from "ember-template-lint";
|
|
2
|
+
|
|
3
|
+
export default class PluginOutletLazyHash extends Rule {
|
|
4
|
+
visitor() {
|
|
5
|
+
return {
|
|
6
|
+
ElementNode(node) {
|
|
7
|
+
if (node.tag === "PluginOutlet") {
|
|
8
|
+
const outletArgsAttr = node.attributes.find(
|
|
9
|
+
(attr) => attr.name === "@outletArgs"
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
if (
|
|
13
|
+
outletArgsAttr &&
|
|
14
|
+
outletArgsAttr.value.type === "MustacheStatement" &&
|
|
15
|
+
outletArgsAttr.value.path.original === "hash"
|
|
16
|
+
) {
|
|
17
|
+
this.log({
|
|
18
|
+
message:
|
|
19
|
+
"Use {{lazyHash}} instead of {{hash}} for @outletArgs in <PluginOutlet>.",
|
|
20
|
+
node: outletArgsAttr.value,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
package/template-lint.config.cjs
CHANGED
|
@@ -29,6 +29,7 @@ module.exports = {
|
|
|
29
29
|
"no-unnecessary-curly-strings": true,
|
|
30
30
|
"simple-modifiers": true,
|
|
31
31
|
"no-chained-this": true,
|
|
32
|
+
"require-strict-mode": true,
|
|
32
33
|
|
|
33
34
|
// Pending non-default rules
|
|
34
35
|
"attribute-order": false,
|
|
@@ -53,6 +54,7 @@ module.exports = {
|
|
|
53
54
|
/-/, // kebab-case, probably a component or helper
|
|
54
55
|
],
|
|
55
56
|
},
|
|
57
|
+
"discourse/plugin-outlet-lazy-hash": true,
|
|
56
58
|
},
|
|
57
59
|
overrides: [
|
|
58
60
|
{
|