@arcgis/eslint-config 4.33.0-next.92 → 4.33.0-next.94
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/dist/config/index.js +12 -30
- package/dist/config/lumina.js +1 -1
- package/dist/makePlugin-W-rZIyei.js +36 -0
- package/dist/plugins/lumina/index.d.ts +1 -2
- package/dist/plugins/lumina/index.js +28 -50
- package/dist/plugins/lumina/plugin.d.ts +8 -0
- package/dist/plugins/lumina/rules/add-missing-jsx-import.d.ts +2 -1
- package/dist/plugins/lumina/rules/auto-add-type.d.ts +2 -1
- package/dist/plugins/lumina/rules/ban-events.d.ts +2 -2
- package/dist/plugins/lumina/rules/component-placement-rules.d.ts +2 -1
- package/dist/plugins/lumina/rules/consistent-event-naming.d.ts +2 -2
- package/dist/plugins/lumina/rules/decorators-context.d.ts +2 -1
- package/dist/plugins/lumina/rules/explicit-setter-type.d.ts +2 -1
- package/dist/plugins/lumina/rules/member-ordering.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-create-element-component.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-ignore-jsdoc-tag.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-incorrect-dynamic-tag-name.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-inline-arrow-in-ref.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-invalid-directives-prop.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-jsx-spread.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-listen-in-connected-callback.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-non-component-exports.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-property-name-start-with-on.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-render-false.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-unnecessary-attribute-name.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-unnecessary-bind-this.d.ts +2 -1
- package/dist/plugins/lumina/rules/no-unnecessary-key.d.ts +2 -1
- package/dist/plugins/lumina/rules/tag-name-rules.d.ts +2 -2
- package/dist/plugins/utils/makePlugin.d.ts +12 -6
- package/dist/plugins/utils/tests.d.ts +5 -3
- package/dist/plugins/webgis/index.d.ts +1 -2
- package/dist/plugins/webgis/index.js +10 -13
- package/dist/plugins/webgis/plugin.d.ts +8 -0
- package/dist/plugins/webgis/rules/no-import-outside-src.d.ts +2 -1
- package/dist/plugins/webgis/rules/no-touching-jsdoc.d.ts +2 -1
- package/dist/plugins/webgis/rules/require-js-in-core-import.d.ts +2 -1
- package/package.json +2 -2
- package/dist/makePlugin-n5hoB6m9.js +0 -22
- package/dist/plugins/lumina/utils/creator.d.ts +0 -3
- package/dist/plugins/webgis/utils/creator.d.ts +0 -3
package/dist/config/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import eslint from "@eslint/js";
|
|
|
2
2
|
import tsEslint from "typescript-eslint";
|
|
3
3
|
import restrictedGlobals from "confusing-browser-globals";
|
|
4
4
|
import globals from "globals";
|
|
5
|
-
import webgisPlugin from "../plugins/webgis/index.js";
|
|
5
|
+
import { webgisPlugin } from "../plugins/webgis/index.js";
|
|
6
6
|
const index = [
|
|
7
7
|
{
|
|
8
8
|
ignores: ["**/www", "**/dist", "**/assets", "**/coverage", "**/.docs"]
|
|
@@ -159,35 +159,17 @@ const index = [
|
|
|
159
159
|
// variable. If you actually mean to use them, prepend with "globalThis."
|
|
160
160
|
"no-restricted-globals": [
|
|
161
161
|
"error",
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"stop",
|
|
174
|
-
"toolbar",
|
|
175
|
-
"top",
|
|
176
|
-
// use Number.POSITIVE_INFINITY instead
|
|
177
|
-
"Infinity",
|
|
178
|
-
// use Number.NaN instead
|
|
179
|
-
"NaN",
|
|
180
|
-
// use Number.isNaN instead
|
|
181
|
-
"isNaN",
|
|
182
|
-
// Use Number.isFinite instead
|
|
183
|
-
"isFinite",
|
|
184
|
-
// use Number.parseFloat instead
|
|
185
|
-
"parseFloat",
|
|
186
|
-
// use Number.parseInt instead
|
|
187
|
-
"parseInt",
|
|
188
|
-
// Use Object.keys instead
|
|
189
|
-
"keys"
|
|
190
|
-
])
|
|
162
|
+
"i",
|
|
163
|
+
"index",
|
|
164
|
+
{ name: "Infinity", message: "Use Number.POSITIVE_INFINITY instead" },
|
|
165
|
+
{ name: "NaN", message: "Use Number.NaN instead" },
|
|
166
|
+
{ name: "isNaN", message: "Use Number.isNaN instead" },
|
|
167
|
+
{ name: "isFinite", message: "Use Number.isFinite instead" },
|
|
168
|
+
{ name: "parseFloat", message: "Use Number.parseFloat instead" },
|
|
169
|
+
{ name: "parseInt", message: "Use Number.parseInt instead" },
|
|
170
|
+
{ name: "keys", message: "Use Object.keys instead" },
|
|
171
|
+
{ name: "values", message: "Use Object.values instead" },
|
|
172
|
+
...restrictedGlobals
|
|
191
173
|
],
|
|
192
174
|
"@typescript-eslint/no-useless-empty-export": "warn",
|
|
193
175
|
// Consider using String.prototype.localeCompare()
|
package/dist/config/lumina.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
2
|
+
const version = "4.33.0-next.94";
|
|
3
|
+
function makeEslintPlugin(pluginName, urlCreator) {
|
|
4
|
+
const rules = [];
|
|
5
|
+
const creator = ESLintUtils.RuleCreator(urlCreator);
|
|
6
|
+
return {
|
|
7
|
+
createRule(rule) {
|
|
8
|
+
const { meta, name, ...rest } = rule;
|
|
9
|
+
const docs = { ...meta.docs, name };
|
|
10
|
+
const ruleModule = creator({ ...rest, meta: { ...meta, docs }, name });
|
|
11
|
+
rules.push(ruleModule);
|
|
12
|
+
return ruleModule;
|
|
13
|
+
},
|
|
14
|
+
finalize() {
|
|
15
|
+
const config = {
|
|
16
|
+
rules: Object.fromEntries(
|
|
17
|
+
rules.map((rule) => [`${pluginName}/${rule.meta.docs.name}`, rule.meta.docs.defaultLevel])
|
|
18
|
+
)
|
|
19
|
+
};
|
|
20
|
+
const plugin = {
|
|
21
|
+
meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version },
|
|
22
|
+
configs: {
|
|
23
|
+
recommended: config
|
|
24
|
+
},
|
|
25
|
+
rules: Object.fromEntries(rules.map((rule) => [rule.meta.docs.name, rule]))
|
|
26
|
+
};
|
|
27
|
+
config.plugins = {
|
|
28
|
+
[pluginName]: plugin
|
|
29
|
+
};
|
|
30
|
+
return plugin;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
makeEslintPlugin as m
|
|
36
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
export declare const luminaPlugin: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
|
|
2
2
|
configs: {
|
|
3
3
|
recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
|
|
4
4
|
};
|
|
5
5
|
};
|
|
6
|
-
export default _default;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as makeEslintPlugin } from "../../makePlugin-W-rZIyei.js";
|
|
2
|
+
import { AST_NODE_TYPES, ESLintUtils, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
|
|
2
3
|
import ts from "typescript";
|
|
3
|
-
import { m as makeEslintPlugin } from "../../makePlugin-n5hoB6m9.js";
|
|
4
4
|
import { camelToKebab } from "@arcgis/components-utils";
|
|
5
|
-
const
|
|
5
|
+
const plugin = makeEslintPlugin(
|
|
6
|
+
"lumina",
|
|
6
7
|
(rule) => `https://devtopia.esri.com/WebGIS/arcgis-web-components/tree/main/packages/support-packages/eslint-config/src/plugins/lumina/rules/${rule}.ts`
|
|
7
8
|
);
|
|
8
9
|
const unwrapExpression = (expression) => expression.type === AST_NODE_TYPES.TSAsExpression || expression.type === AST_NODE_TYPES.TSNonNullExpression || expression.type === AST_NODE_TYPES.TSSatisfiesExpression ? unwrapExpression(expression.expression) : expression;
|
|
@@ -95,7 +96,7 @@ function isBindThisCallee(callee) {
|
|
|
95
96
|
}
|
|
96
97
|
const importDeclaration = `import { ${luminaJsxExportName} } from "${luminaEntrypointName}";`;
|
|
97
98
|
const description$i = `To use Lumina's JSX, you need to ${importDeclaration}`;
|
|
98
|
-
|
|
99
|
+
plugin.createRule({
|
|
99
100
|
name: "add-missing-jsx-import",
|
|
100
101
|
meta: {
|
|
101
102
|
docs: {
|
|
@@ -161,7 +162,7 @@ const addMissingJsxImport = createRule({
|
|
|
161
162
|
}
|
|
162
163
|
});
|
|
163
164
|
const description$h = "Auto add { type: Boolean } or { type: Number } where necessary";
|
|
164
|
-
|
|
165
|
+
plugin.createRule({
|
|
165
166
|
name: "auto-add-type",
|
|
166
167
|
meta: {
|
|
167
168
|
docs: {
|
|
@@ -326,7 +327,7 @@ function inferTrivialType(member) {
|
|
|
326
327
|
return "Other";
|
|
327
328
|
}
|
|
328
329
|
const builtInConverterTypes = /* @__PURE__ */ new Set(["Number", "Boolean", "Array", "Object"]);
|
|
329
|
-
|
|
330
|
+
plugin.createRule({
|
|
330
331
|
name: "ban-events",
|
|
331
332
|
defaultOptions: [],
|
|
332
333
|
meta: {
|
|
@@ -402,7 +403,7 @@ const banEvents = createRule({
|
|
|
402
403
|
}
|
|
403
404
|
});
|
|
404
405
|
const description$g = `Lumina component must be declared in a TSX file with a matching folder name located inside of src/components folder.`;
|
|
405
|
-
|
|
406
|
+
plugin.createRule({
|
|
406
407
|
name: "component-placement-rules",
|
|
407
408
|
meta: {
|
|
408
409
|
docs: {
|
|
@@ -452,7 +453,7 @@ const defaultOptions$1 = [
|
|
|
452
453
|
includeComponentNameInEventName: false
|
|
453
454
|
}
|
|
454
455
|
];
|
|
455
|
-
|
|
456
|
+
plugin.createRule({
|
|
456
457
|
name: "consistent-event-naming",
|
|
457
458
|
meta: {
|
|
458
459
|
docs: {
|
|
@@ -558,7 +559,7 @@ Discussion: https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/3
|
|
|
558
559
|
});
|
|
559
560
|
const capitalAfterLower = /(?<=[a-z\d])[A-Z]/u;
|
|
560
561
|
const description$e = `Enforce that @property(), @method() and createEvent() members are used in the correct context.`;
|
|
561
|
-
|
|
562
|
+
plugin.createRule({
|
|
562
563
|
name: "decorators-context",
|
|
563
564
|
meta: {
|
|
564
565
|
docs: {
|
|
@@ -663,7 +664,7 @@ Lumina automatically creates an attribute for a property if property type includ
|
|
|
663
664
|
For bound properties, the property type by default comes from the bound getter type.
|
|
664
665
|
The property you are trying to bind includes a literal in the setter type, but not the getter type.
|
|
665
666
|
An explicit type annotation is required to ensure the property has an attribute created.`;
|
|
666
|
-
|
|
667
|
+
plugin.createRule({
|
|
667
668
|
name: "explicit-setter-type",
|
|
668
669
|
meta: {
|
|
669
670
|
docs: {
|
|
@@ -1050,7 +1051,7 @@ ${newBodyContent}
|
|
|
1050
1051
|
return newBody;
|
|
1051
1052
|
}
|
|
1052
1053
|
const baseDescription$3 = `Consistently sort component members`;
|
|
1053
|
-
|
|
1054
|
+
plugin.createRule({
|
|
1054
1055
|
name: "member-ordering",
|
|
1055
1056
|
meta: {
|
|
1056
1057
|
docs: {
|
|
@@ -1168,7 +1169,7 @@ const blockListedCustomElementNames = /* @__PURE__ */ new Set([
|
|
|
1168
1169
|
"font-face-name",
|
|
1169
1170
|
"missing-glyph"
|
|
1170
1171
|
]);
|
|
1171
|
-
|
|
1172
|
+
plugin.createRule({
|
|
1172
1173
|
name: "no-create-element-component",
|
|
1173
1174
|
defaultOptions: [],
|
|
1174
1175
|
meta: {
|
|
@@ -1218,7 +1219,7 @@ function isCustomElementTag(tag) {
|
|
|
1218
1219
|
return tag.includes("-") && !blockListedCustomElementNames.has(tag);
|
|
1219
1220
|
}
|
|
1220
1221
|
const description$c = `Use @internal or @private JSDoc tag over @ignore. See https://qawebgis.esri.com/components/lumina/documenting-components#excluding-api-from-public-documentation`;
|
|
1221
|
-
|
|
1222
|
+
plugin.createRule({
|
|
1222
1223
|
name: "no-ignore-jsdoc-tag",
|
|
1223
1224
|
meta: {
|
|
1224
1225
|
docs: {
|
|
@@ -1256,7 +1257,7 @@ const noIgnoreJsDocTag = createRule({
|
|
|
1256
1257
|
});
|
|
1257
1258
|
const reIgnore = /\* @ignore/gu;
|
|
1258
1259
|
const description$b = `Detect incorrect usage of dynamic JSX tag name`;
|
|
1259
|
-
|
|
1260
|
+
plugin.createRule({
|
|
1260
1261
|
name: "no-incorrect-dynamic-tag-name",
|
|
1261
1262
|
meta: {
|
|
1262
1263
|
docs: {
|
|
@@ -1307,7 +1308,7 @@ const baseDescription$2 = `Do not pass an inline arrow function to a ref prop -
|
|
|
1307
1308
|
const description$a = `${baseDescription$2}
|
|
1308
1309
|
|
|
1309
1310
|
Alternatives: https://qawebgis.esri.com/components/lumina/jsx#refs`;
|
|
1310
|
-
|
|
1311
|
+
plugin.createRule({
|
|
1311
1312
|
name: "no-inline-arrow-in-ref",
|
|
1312
1313
|
meta: {
|
|
1313
1314
|
docs: {
|
|
@@ -1342,7 +1343,7 @@ const noInlineArrowInRef = createRule({
|
|
|
1342
1343
|
}
|
|
1343
1344
|
});
|
|
1344
1345
|
const description$9 = `directives={} prop value must be an array literal. Documentation: https://qawebgis.esri.com/components/lumina/jsx#lit-directives`;
|
|
1345
|
-
|
|
1346
|
+
plugin.createRule({
|
|
1346
1347
|
name: "no-invalid-directives-prop",
|
|
1347
1348
|
meta: {
|
|
1348
1349
|
docs: {
|
|
@@ -1388,7 +1389,7 @@ const noInvalidDirectivesProp = createRule({
|
|
|
1388
1389
|
}
|
|
1389
1390
|
});
|
|
1390
1391
|
const description$8 = `This spread syntax is not supported. Alternatives: https://qawebgis.esri.com/components/lumina/jsx#spread-attributes`;
|
|
1391
|
-
|
|
1392
|
+
plugin.createRule({
|
|
1392
1393
|
name: "no-jsx-spread",
|
|
1393
1394
|
meta: {
|
|
1394
1395
|
docs: {
|
|
@@ -1433,7 +1434,7 @@ Instead, call this.listen()/this.listenOn() in constructor(), load() or loaded()
|
|
|
1433
1434
|
Reason:
|
|
1434
1435
|
this.listen() automatically creates and cleanups the listener on connect/disconnect.
|
|
1435
1436
|
Since connectedCallback can be called multiple times, duplicate listeners may be created.`;
|
|
1436
|
-
|
|
1437
|
+
plugin.createRule({
|
|
1437
1438
|
name: "no-listen-in-connected-callback",
|
|
1438
1439
|
meta: {
|
|
1439
1440
|
docs: {
|
|
@@ -1477,7 +1478,7 @@ const noListenInConnectedCallback = createRule({
|
|
|
1477
1478
|
}
|
|
1478
1479
|
});
|
|
1479
1480
|
const description$6 = `To ensure Hot Module Replacement (HMR) works correctly, the file that defines the Lumina component must not export anything other than the component. Exceptions: type-only exports, and the \`exportsForTests\` object for exposing additional things for usages in tests only`;
|
|
1480
|
-
|
|
1481
|
+
plugin.createRule({
|
|
1481
1482
|
name: "no-non-component-exports",
|
|
1482
1483
|
meta: {
|
|
1483
1484
|
docs: {
|
|
@@ -1574,7 +1575,7 @@ const noNonComponentExports = createRule({
|
|
|
1574
1575
|
}
|
|
1575
1576
|
});
|
|
1576
1577
|
const description$5 = `Do not start public property names with "on" as that can confuse frameworks into thinking this property is an event`;
|
|
1577
|
-
|
|
1578
|
+
plugin.createRule({
|
|
1578
1579
|
name: "no-property-name-start-with-on",
|
|
1579
1580
|
meta: {
|
|
1580
1581
|
docs: {
|
|
@@ -1619,7 +1620,7 @@ const baseDescription = `Avoid accidentally rendering "false" to the screen (Lit
|
|
|
1619
1620
|
const description$4 = `${baseDescription}
|
|
1620
1621
|
|
|
1621
1622
|
Lumina automatically handles some cases where "false" may get rendered to the screen, but the pattern this code is using is not handled.`;
|
|
1622
|
-
|
|
1623
|
+
plugin.createRule({
|
|
1623
1624
|
name: "no-render-false",
|
|
1624
1625
|
meta: {
|
|
1625
1626
|
docs: {
|
|
@@ -1670,7 +1671,7 @@ const noRenderFalse = createRule({
|
|
|
1670
1671
|
}
|
|
1671
1672
|
});
|
|
1672
1673
|
const description$3 = 'There is no need for { attribute: "name" } in @property() when attribute name is trivially inferrable from the property name';
|
|
1673
|
-
|
|
1674
|
+
plugin.createRule({
|
|
1674
1675
|
name: "no-unnecessary-attribute-name",
|
|
1675
1676
|
meta: {
|
|
1676
1677
|
docs: {
|
|
@@ -1723,7 +1724,7 @@ const noUnnecessaryAttributeName = createRule({
|
|
|
1723
1724
|
}
|
|
1724
1725
|
});
|
|
1725
1726
|
const description$2 = `.bind(this) is not necessary in Lit's event listener callbacks and ref callbacks as it is handled automatically.`;
|
|
1726
|
-
|
|
1727
|
+
plugin.createRule({
|
|
1727
1728
|
name: "no-unnecessary-bind-this",
|
|
1728
1729
|
meta: {
|
|
1729
1730
|
docs: {
|
|
@@ -1786,7 +1787,7 @@ const noUnnecessaryBindThis = createRule({
|
|
|
1786
1787
|
}
|
|
1787
1788
|
});
|
|
1788
1789
|
const description$1 = `In most cases, key={index} is not necessary in Lumina in .map(). Details: https://qawebgis.esri.com/components/lumina/jsx#key-prop`;
|
|
1789
|
-
|
|
1790
|
+
plugin.createRule({
|
|
1790
1791
|
name: "no-unnecessary-key",
|
|
1791
1792
|
meta: {
|
|
1792
1793
|
docs: {
|
|
@@ -1852,7 +1853,7 @@ const defaultOptions = [
|
|
|
1852
1853
|
namespaces: ["arcgis-"]
|
|
1853
1854
|
}
|
|
1854
1855
|
];
|
|
1855
|
-
|
|
1856
|
+
plugin.createRule({
|
|
1856
1857
|
name: "tag-name-rules",
|
|
1857
1858
|
meta: {
|
|
1858
1859
|
docs: {
|
|
@@ -2066,30 +2067,7 @@ declare global {
|
|
|
2066
2067
|
});
|
|
2067
2068
|
const tagNameToNormalizedClassName = (tagName) => tagName.replaceAll("-", "").toLowerCase();
|
|
2068
2069
|
const reCustomElementName = /^[a-z]+(?:-[a-z\d]+)+$/u;
|
|
2069
|
-
const luminaPlugin =
|
|
2070
|
-
"add-missing-jsx-import": addMissingJsxImport,
|
|
2071
|
-
"auto-add-type": autoAddType,
|
|
2072
|
-
"ban-events": banEvents,
|
|
2073
|
-
"component-placement-rules": componentPlacementRules,
|
|
2074
|
-
"consistent-event-naming": consistentEventNaming,
|
|
2075
|
-
"decorators-context": decoratorsContext,
|
|
2076
|
-
"explicit-setter-type": explicitSetterType,
|
|
2077
|
-
"member-ordering": memberOrdering,
|
|
2078
|
-
"no-create-element-component": noCreateElementComponent,
|
|
2079
|
-
"no-ignore-jsdoc-tag": noIgnoreJsDocTag,
|
|
2080
|
-
"no-incorrect-dynamic-tag-name": noIncorrectDynamicTagName,
|
|
2081
|
-
"no-inline-arrow-in-ref": noInlineArrowInRef,
|
|
2082
|
-
"no-invalid-directives-prop": noInvalidDirectivesProp,
|
|
2083
|
-
"no-jsx-spread": noJsxSpread,
|
|
2084
|
-
"no-listen-in-connected-callback": noListenInConnectedCallback,
|
|
2085
|
-
"no-non-component-exports": noNonComponentExports,
|
|
2086
|
-
"no-property-name-start-with-on": noPropertyNameStartWithOn,
|
|
2087
|
-
"no-render-false": noRenderFalse,
|
|
2088
|
-
"no-unnecessary-attribute-name": noUnnecessaryAttributeName,
|
|
2089
|
-
"no-unnecessary-bind-this": noUnnecessaryBindThis,
|
|
2090
|
-
"no-unnecessary-key": noUnnecessaryKey,
|
|
2091
|
-
"tag-name-rules": tagNameRules
|
|
2092
|
-
});
|
|
2070
|
+
const luminaPlugin = plugin.finalize();
|
|
2093
2071
|
export {
|
|
2094
|
-
luminaPlugin
|
|
2072
|
+
luminaPlugin
|
|
2095
2073
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const plugin: {
|
|
2
|
+
createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<import('@typescript-eslint/utils/eslint-utils').RuleWithMetaAndName<Options, MessageIds, Omit<import('../utils/makePlugin').CommonDocs, "name">>>) => import('@typescript-eslint/utils/ts-eslint').RuleModule<MessageIds, Options, import('../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
3
|
+
finalize: () => import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
|
|
4
|
+
configs: {
|
|
5
|
+
recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"addMissingJsxImport", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
|
|
2
|
+
declare const _default: ESLintUtils.RuleModule<"addType" | "typeAnnotationMismatchesActualType" | "noEmptyPropertyObject" | "noUnnecessaryType" | "unhandledType", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
|
|
3
|
+
export default _default;
|
|
@@ -2,5 +2,5 @@ type Options = (string | {
|
|
|
2
2
|
event: string;
|
|
3
3
|
message?: string;
|
|
4
4
|
})[];
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"default", Options, import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
6
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"fileFolderNameMismatch" | "extensionNotTsx" | "noComponentOutsideSrcComponents", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -11,5 +11,5 @@ type Options = [
|
|
|
11
11
|
}
|
|
12
12
|
];
|
|
13
13
|
type Messages = "componentNameInEventError" | "eventNamespaceError" | "missingPrivateJsDocTag" | "noComponentNameInEventError";
|
|
14
|
-
|
|
15
|
-
export
|
|
14
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<Messages, Options, import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
15
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"publicApiMustBePublic" | "noPropertyDecoratorOnMethods" | "noCombinedPropertyEvent" | "noCombinedPropertyState" | "noComputedName", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -15,4 +15,5 @@ import { ESLintUtils } from '@typescript-eslint/utils';
|
|
|
15
15
|
* type. Then we can use it as is in the .d.ts file. The getter type can be
|
|
16
16
|
* retrieved easily via `typeof` operator.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
declare const _default: ESLintUtils.RuleModule<"explicitSetterType" | "addExplicitSetterType", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
|
|
19
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"memberOrdering" | "unsupportedElementType", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"default", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noIgnoreJsDocTag", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
|
|
2
|
+
declare const _default: ESLintUtils.RuleModule<"incorrectDynamicTagName", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
|
|
3
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"errorInlineArrow", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noInvalidDirectivesProp", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noJsxSpread", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"errorListenInConnectedCallback", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noNonComponentExports" | "noDefaultExports" | "noExportAll", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noPropertyNameStartWithOn", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
|
|
2
|
+
declare const _default: ESLintUtils.RuleModule<"errorFalseRendered", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
|
|
3
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryAttributeName", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryBindThis", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryKey", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -4,5 +4,5 @@ type Options = [
|
|
|
4
4
|
}
|
|
5
5
|
];
|
|
6
6
|
type Messages = "duplicateDeclaration" | "duplicateDeclareGlobal" | "invalidTagName" | "lowercaseTagName" | "missingClassDeclaration" | "missingHyphen" | "mustNotSubclassHtmlElement" | "mustSubclass" | "noComputedTagName" | "noNonStringTagName" | "noTagNameIdentifier" | "requireNamespace" | "reservedTagName" | "tagNameClassNameMismatch" | "unexpectedDeclarationType" | "unexpectedDeclareElementsEntry" | "unexpectedTypeArguments";
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<Messages, Options, import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
8
|
+
export default _default;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TSESLint } from '@typescript-eslint/utils';
|
|
1
|
+
import { TSESLint, ESLintUtils } from '@typescript-eslint/utils';
|
|
3
2
|
export type CommonDocs = {
|
|
4
3
|
description: string;
|
|
5
|
-
defaultLevel: "error" | "warn";
|
|
4
|
+
defaultLevel: "error" | "off" | "warn";
|
|
5
|
+
name: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* A helper function to create an ESLint plugin with less boilerplate
|
|
9
|
+
*/
|
|
10
|
+
export declare function makeEslintPlugin<PluginDocs extends CommonDocs = CommonDocs>(pluginName: string, urlCreator: (ruleName: string) => string): {
|
|
11
|
+
createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, Omit<PluginDocs, "name">>>) => ESLintUtils.RuleModule<MessageIds, Options, PluginDocs>;
|
|
12
|
+
finalize: () => TSESLint.FlatConfig.Plugin & {
|
|
13
|
+
configs: {
|
|
14
|
+
recommended: TSESLint.FlatConfig.Config;
|
|
15
|
+
};
|
|
10
16
|
};
|
|
11
17
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ESLintUtils, TSUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import { CommonDocs } from './makePlugin';
|
|
3
|
+
import { RunTests } from '@typescript-eslint/rule-tester';
|
|
4
|
+
export declare function testUntypedRule<MessageIds extends string, Options extends readonly unknown[]>(rule: ESLintUtils.RuleModule<MessageIds, Options, CommonDocs>, test: RunTests<TSUtils.NoInfer<MessageIds>, TSUtils.NoInfer<Options>>): void;
|
|
5
|
+
export declare function testTypedRule<MessageIds extends string, Options extends readonly unknown[]>(rule: ESLintUtils.RuleModule<MessageIds, Options, CommonDocs>, test: RunTests<TSUtils.NoInfer<MessageIds>, TSUtils.NoInfer<Options>>): void;
|
|
4
6
|
/**
|
|
5
7
|
* A helper for authoring before/after autofix diff in a way that makes it easy
|
|
6
8
|
* to see what part of the code changed, and avoids duplication.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
export declare const webgisPlugin: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
|
|
2
2
|
configs: {
|
|
3
3
|
recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
|
|
4
4
|
};
|
|
5
5
|
};
|
|
6
|
-
export default _default;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { m as makeEslintPlugin } from "../../makePlugin-
|
|
2
|
-
import { ESLintUtils, AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
1
|
+
import { m as makeEslintPlugin } from "../../makePlugin-W-rZIyei.js";
|
|
3
2
|
import { resolve } from "node:path/posix";
|
|
4
|
-
|
|
5
|
-
const
|
|
3
|
+
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
4
|
+
const plugin = makeEslintPlugin(
|
|
5
|
+
"webgis",
|
|
6
6
|
(rule) => `https://devtopia.esri.com/WebGIS/arcgis-web-components/tree/main/packages/support-packages/eslint-config/src/plugins/webgis/rules/${rule}.ts`
|
|
7
7
|
);
|
|
8
|
+
const isTestFile = (filePath) => filePath.includes("/test") || filePath.includes(".test") || filePath.includes(".spec") || filePath.includes("e2e") || filePath.includes("__") || filePath.includes("/.");
|
|
8
9
|
const description$2 = `Imports of files outside the src/ folder are not-portable and likely to break for consumers of this package.`;
|
|
9
|
-
|
|
10
|
+
plugin.createRule({
|
|
10
11
|
name: "no-import-outside-src",
|
|
11
12
|
meta: {
|
|
12
13
|
docs: {
|
|
@@ -49,7 +50,7 @@ const noImportOutsideSrc = createRule({
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
const description$1 = `Having two JSDoc comments next to each other is most likely a mistake - consider combining them into one, or separating them for clarity.`;
|
|
52
|
-
|
|
53
|
+
plugin.createRule({
|
|
53
54
|
name: "no-touching-jsdoc",
|
|
54
55
|
meta: {
|
|
55
56
|
docs: {
|
|
@@ -94,7 +95,7 @@ const noTouchingJsDoc = createRule({
|
|
|
94
95
|
});
|
|
95
96
|
const reTouchingJsDoc = /\*\/\s+\/\*\*/gu;
|
|
96
97
|
const description = `@arcgis/core imports need to end with .js for better compatibility with @arcgis/core ESM CDN builds.`;
|
|
97
|
-
|
|
98
|
+
plugin.createRule({
|
|
98
99
|
name: "require-js-in-core-import",
|
|
99
100
|
meta: {
|
|
100
101
|
docs: {
|
|
@@ -134,11 +135,7 @@ const requireJsInCoreImport = createRule({
|
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
137
|
});
|
|
137
|
-
const webgisPlugin =
|
|
138
|
-
"no-import-outside-src": noImportOutsideSrc,
|
|
139
|
-
"no-touching-jsdoc": noTouchingJsDoc,
|
|
140
|
-
"require-js-in-core-import": requireJsInCoreImport
|
|
141
|
-
});
|
|
138
|
+
const webgisPlugin = plugin.finalize();
|
|
142
139
|
export {
|
|
143
|
-
webgisPlugin
|
|
140
|
+
webgisPlugin
|
|
144
141
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const plugin: {
|
|
2
|
+
createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<import('@typescript-eslint/utils/eslint-utils').RuleWithMetaAndName<Options, MessageIds, Omit<import('../utils/makePlugin').CommonDocs, "name">>>) => import('@typescript-eslint/utils/ts-eslint').RuleModule<MessageIds, Options, import('../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
3
|
+
finalize: () => import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
|
|
4
|
+
configs: {
|
|
5
|
+
recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noImportOutsideSrc", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noTouchingJsDoc", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"requireJsInCoreImport", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
|
|
2
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/eslint-config",
|
|
3
|
-
"version": "4.33.0-next.
|
|
3
|
+
"version": "4.33.0-next.94",
|
|
4
4
|
"description": "ESLint configuration for arcgis-web-components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@arcgis/components-utils": "4.33.0-next.
|
|
22
|
+
"@arcgis/components-utils": "4.33.0-next.94",
|
|
23
23
|
"@eslint/js": "^9.17.0",
|
|
24
24
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
25
25
|
"confusing-browser-globals": "^1.0.11",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const version = "4.33.0-next.92";
|
|
2
|
-
function makeEslintPlugin(pluginName, rules) {
|
|
3
|
-
const config = {
|
|
4
|
-
rules: Object.fromEntries(
|
|
5
|
-
Object.entries(rules).map(([name, rule]) => [`${pluginName}/${name}`, rule.meta.docs.defaultLevel])
|
|
6
|
-
)
|
|
7
|
-
};
|
|
8
|
-
const plugin = {
|
|
9
|
-
meta: { name: "@arcgis/eslint-plugin-webgis", version },
|
|
10
|
-
configs: {
|
|
11
|
-
recommended: config
|
|
12
|
-
},
|
|
13
|
-
rules
|
|
14
|
-
};
|
|
15
|
-
config.plugins = {
|
|
16
|
-
[pluginName]: plugin
|
|
17
|
-
};
|
|
18
|
-
return plugin;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
makeEslintPlugin as m
|
|
22
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import { CommonDocs } from '../../utils/makePlugin';
|
|
3
|
-
export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, CommonDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, CommonDocs, ESLintUtils.RuleListener>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import { CommonDocs } from '../../utils/makePlugin';
|
|
3
|
-
export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, CommonDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, CommonDocs, ESLintUtils.RuleListener>;
|