@arcgis/eslint-config 5.2.0-next.5 → 5.2.0-next.51
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/applications.d.ts +4 -3
- package/dist/config/applications.js +4 -6
- package/dist/config/extra.d.ts +4 -24
- package/dist/config/extra.js +2 -2
- package/dist/config/index.d.ts +3 -2
- package/dist/config/index.js +10 -5
- package/dist/config/lumina.d.ts +4 -3
- package/dist/config/lumina.js +8 -8
- package/dist/{estree-C35TbJCf.js → estree-CDc-die8.js} +1 -39
- package/dist/makePlugin-DwtvWDJv.js +41 -0
- package/dist/plugins/core/index.d.ts +4 -0
- package/dist/plugins/core/index.js +729 -0
- package/dist/plugins/lumina/index.d.ts +4 -5
- package/dist/plugins/lumina/index.js +2 -1
- package/dist/plugins/utils/makePlugin.d.ts +15 -16
- package/dist/plugins/webgis/index.d.ts +4 -5
- package/dist/plugins/webgis/index.js +795 -119
- package/dist/utils/defineBoundaries.d.ts +22 -38
- package/dist/utils/disableRules.d.ts +6 -6
- package/package.json +11 -9
- package/dist/config/storybook.d.ts +0 -2
- package/dist/plugins/lumina/plugin.d.ts +0 -8
- package/dist/plugins/lumina/rules/add-missing-jsx-import.d.ts +0 -2
- package/dist/plugins/lumina/rules/auto-add-type.d.ts +0 -3
- package/dist/plugins/lumina/rules/ban-events.d.ts +0 -6
- package/dist/plugins/lumina/rules/component-placement-rules.d.ts +0 -2
- package/dist/plugins/lumina/rules/consistent-event-naming.d.ts +0 -15
- package/dist/plugins/lumina/rules/consistent-nullability.d.ts +0 -2
- package/dist/plugins/lumina/rules/decorators-context.d.ts +0 -2
- package/dist/plugins/lumina/rules/explicit-setter-type.d.ts +0 -19
- package/dist/plugins/lumina/rules/member-ordering/build.d.ts +0 -4
- package/dist/plugins/lumina/rules/member-ordering/comments.d.ts +0 -19
- package/dist/plugins/lumina/rules/member-ordering/config.d.ts +0 -36
- package/dist/plugins/lumina/rules/member-ordering/normalize.d.ts +0 -10
- package/dist/plugins/lumina/rules/member-ordering.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-create-element-component.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-ignore-jsdoc-tag.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-incorrect-dynamic-tag-name.d.ts +0 -3
- package/dist/plugins/lumina/rules/no-inline-arrow-in-ref.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-inline-exposure-jsdoc-tag.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-invalid-directives-prop.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-jsdoc-xref-links.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-jsx-spread.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-listen-in-connected-callback.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-non-component-exports.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-property-name-start-with-on.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-render-false.d.ts +0 -3
- package/dist/plugins/lumina/rules/no-unnecessary-assertion-on-event.d.ts +0 -3
- package/dist/plugins/lumina/rules/no-unnecessary-attribute-name.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-unnecessary-bind-this.d.ts +0 -2
- package/dist/plugins/lumina/rules/no-unnecessary-key.d.ts +0 -2
- package/dist/plugins/lumina/rules/tag-name-rules.d.ts +0 -8
- package/dist/plugins/lumina/utils/checker.d.ts +0 -4
- package/dist/plugins/lumina/utils/estree.d.ts +0 -33
- package/dist/plugins/lumina/utils/tags.d.ts +0 -14
- package/dist/plugins/utils/helpers.d.ts +0 -2
- package/dist/plugins/webgis/plugin.d.ts +0 -8
- package/dist/plugins/webgis/rules/consistent-logging.d.ts +0 -2
- package/dist/plugins/webgis/rules/no-dts-files.d.ts +0 -2
- package/dist/plugins/webgis/rules/no-import-outside-src.d.ts +0 -2
- package/dist/plugins/webgis/rules/no-story-render-args-type-annotation.d.ts +0 -2
- package/dist/plugins/webgis/rules/no-touching-jsdoc.d.ts +0 -2
- package/dist/plugins/webgis/rules/no-unsafe-hash-links.d.ts +0 -2
- package/dist/plugins/webgis/rules/require-js-in-imports.d.ts +0 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { TSESLint } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { TSESLint } from "@typescript-eslint/utils";
|
|
2
|
+
|
|
3
|
+
declare const config: TSESLint.FlatConfig.ConfigArray;
|
|
4
|
+
export default config;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import config from "./index.js";
|
|
2
|
-
const
|
|
3
|
-
...config,
|
|
1
|
+
import config$1 from "./index.js";
|
|
2
|
+
const config = [
|
|
3
|
+
...config$1,
|
|
4
4
|
{
|
|
5
5
|
rules: {
|
|
6
6
|
// Not autofixable. Can be annoying
|
|
@@ -28,13 +28,11 @@ const applications = [
|
|
|
28
28
|
"func-names": "off",
|
|
29
29
|
// This rule is for consistency between library developers - less important for monolith apps.
|
|
30
30
|
"id-denylist": "off",
|
|
31
|
-
// Some cases actually require sequential async loops
|
|
32
|
-
"no-await-in-loop": "off",
|
|
33
31
|
// More important for library-exposed symbols than apps
|
|
34
32
|
"symbol-description": "off"
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
];
|
|
38
36
|
export {
|
|
39
|
-
|
|
37
|
+
config as default
|
|
40
38
|
};
|
package/dist/config/extra.d.ts
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* they have too many false positives or are too slow.
|
|
6
|
-
*/
|
|
7
|
-
declare const _default: {
|
|
8
|
-
files: string[];
|
|
9
|
-
rules: {
|
|
10
|
-
"@typescript-eslint/no-unsafe-return": "warn";
|
|
11
|
-
"@typescript-eslint/unbound-method": "warn";
|
|
12
|
-
"class-methods-use-this": "off";
|
|
13
|
-
"@typescript-eslint/class-methods-use-this": ["warn", {
|
|
14
|
-
ignoreOverrideMethods: boolean;
|
|
15
|
-
ignoreClassesThatImplementAnInterface: string;
|
|
16
|
-
}];
|
|
17
|
-
/**
|
|
18
|
-
* False positive when constructor exists to improve typing/narrow down the
|
|
19
|
-
* type
|
|
20
|
-
*/
|
|
21
|
-
"@typescript-eslint/no-useless-constructor": "warn";
|
|
22
|
-
};
|
|
23
|
-
}[];
|
|
24
|
-
export default _default;
|
|
1
|
+
import type { TSESLint } from "@typescript-eslint/utils";
|
|
2
|
+
|
|
3
|
+
declare const config: TSESLint.FlatConfig.ConfigArray;
|
|
4
|
+
export default config;
|
package/dist/config/extra.js
CHANGED
package/dist/config/index.d.ts
CHANGED
package/dist/config/index.js
CHANGED
|
@@ -145,8 +145,10 @@ const config = [
|
|
|
145
145
|
* consider refactoring to less confusing syntax instead
|
|
146
146
|
*
|
|
147
147
|
*/
|
|
148
|
-
//
|
|
149
|
-
|
|
148
|
+
// Too many false positives. Some cases require sequential execution of
|
|
149
|
+
// async code for correctness, cleaner output, or to avoid performance
|
|
150
|
+
// constraints
|
|
151
|
+
"no-await-in-loop": "off",
|
|
150
152
|
"no-constructor-return": "warn",
|
|
151
153
|
"no-fallthrough": ["error", { reportUnusedFallthroughComment: true }],
|
|
152
154
|
// This mis-fires for anonymous functions when not wrapped in {}
|
|
@@ -181,11 +183,11 @@ const config = [
|
|
|
181
183
|
"index",
|
|
182
184
|
{
|
|
183
185
|
name: "isNaN",
|
|
184
|
-
message: "Use Number.isNaN instead as it has more predictable behavior. See https://developer.mozilla.org/
|
|
186
|
+
message: "Use Number.isNaN instead as it has more predictable behavior. See https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description"
|
|
185
187
|
},
|
|
186
188
|
{
|
|
187
189
|
name: "isFinite",
|
|
188
|
-
message: "Use Number.isFinite instead as it has more predictable behavior. See https://developer.mozilla.org/
|
|
190
|
+
message: "Use Number.isFinite instead as it has more predictable behavior. See https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description (same applies to isFinite)"
|
|
189
191
|
},
|
|
190
192
|
{
|
|
191
193
|
name: "parseInt",
|
|
@@ -464,7 +466,10 @@ const config = [
|
|
|
464
466
|
// rule - give it more time to catch the bug cases. Also, this rule
|
|
465
467
|
// changes runtime behavior, and may lead to breaking changes.
|
|
466
468
|
"@typescript-eslint/no-useless-default-assignment": "off",
|
|
467
|
-
|
|
469
|
+
// Since https://devtopia.esri.com/WebGIS/arcgis-web-components/pull/17821,
|
|
470
|
+
// this rule has more true positives, but also many more false positives.
|
|
471
|
+
// The autofix often causes TypeScript errors, and new ESLint errors
|
|
472
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
|
468
473
|
"@typescript-eslint/prefer-includes": ["warn"],
|
|
469
474
|
"@typescript-eslint/prefer-reduce-type-parameter": ["warn"],
|
|
470
475
|
"@typescript-eslint/prefer-return-this-type": ["warn"],
|
package/dist/config/lumina.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { TSESLint } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { TSESLint } from "@typescript-eslint/utils";
|
|
2
|
+
|
|
3
|
+
declare const config: TSESLint.FlatConfig.ConfigArray;
|
|
4
|
+
export default config;
|
package/dist/config/lumina.js
CHANGED
|
@@ -4,16 +4,16 @@ const storybookConfig = [
|
|
|
4
4
|
{
|
|
5
5
|
ignores: ["**/storybook-static*"]
|
|
6
6
|
},
|
|
7
|
-
...eslintPluginStorybook.configs["flat/recommended"].map((
|
|
8
|
-
...
|
|
7
|
+
...eslintPluginStorybook.configs["flat/recommended"].map((config2) => ({
|
|
8
|
+
...config2,
|
|
9
9
|
files: ["**/*.stories.@(ts|tsx)"]
|
|
10
10
|
})),
|
|
11
|
-
...eslintPluginStorybook.configs["flat/addon-interactions"].map((
|
|
12
|
-
...
|
|
11
|
+
...eslintPluginStorybook.configs["flat/addon-interactions"].map((config2) => ({
|
|
12
|
+
...config2,
|
|
13
13
|
files: ["**/*.stories.@(ts|tsx)"]
|
|
14
14
|
})),
|
|
15
|
-
...eslintPluginStorybook.configs["flat/csf-strict"].map((
|
|
16
|
-
...
|
|
15
|
+
...eslintPluginStorybook.configs["flat/csf-strict"].map((config2) => ({
|
|
16
|
+
...config2,
|
|
17
17
|
files: ["**/*.stories.@(ts|tsx)"]
|
|
18
18
|
})),
|
|
19
19
|
{
|
|
@@ -42,7 +42,7 @@ const storybookConfig = [
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
];
|
|
45
|
-
const
|
|
45
|
+
const config = [
|
|
46
46
|
...storybookConfig,
|
|
47
47
|
{
|
|
48
48
|
...luminaPlugin.configs.recommended,
|
|
@@ -218,5 +218,5 @@ declare global {
|
|
|
218
218
|
},*/
|
|
219
219
|
];
|
|
220
220
|
export {
|
|
221
|
-
|
|
221
|
+
config as default
|
|
222
222
|
};
|
|
@@ -1,41 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const version = "5.2.0-next.5";
|
|
3
|
-
const packageJson = {
|
|
4
|
-
version
|
|
5
|
-
};
|
|
6
|
-
function makeEslintPlugin(pluginName, urlCreator) {
|
|
7
|
-
const rules = [];
|
|
8
|
-
const creator = ESLintUtils.RuleCreator(urlCreator);
|
|
9
|
-
return {
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
11
|
-
createRule(rule) {
|
|
12
|
-
const { meta, name, ...rest } = rule;
|
|
13
|
-
const docs = { ...meta.docs, name };
|
|
14
|
-
const ruleModule = creator({ ...rest, meta: { ...meta, docs }, name });
|
|
15
|
-
rules.push(ruleModule);
|
|
16
|
-
return ruleModule;
|
|
17
|
-
},
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
19
|
-
finalize() {
|
|
20
|
-
const config = {
|
|
21
|
-
rules: Object.fromEntries(
|
|
22
|
-
rules.map((rule) => [`${pluginName}/${rule.meta.docs.name}`, rule.meta.docs.defaultLevel])
|
|
23
|
-
)
|
|
24
|
-
};
|
|
25
|
-
const plugin = {
|
|
26
|
-
meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version: packageJson.version },
|
|
27
|
-
configs: {
|
|
28
|
-
recommended: config
|
|
29
|
-
},
|
|
30
|
-
rules: Object.fromEntries(rules.map((rule) => [rule.meta.docs.name, rule]))
|
|
31
|
-
};
|
|
32
|
-
config.plugins = {
|
|
33
|
-
[pluginName]: plugin
|
|
34
|
-
};
|
|
35
|
-
return plugin;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
1
|
+
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
39
2
|
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;
|
|
40
3
|
const luminaEntrypointName = "@arcgis/lumina";
|
|
41
4
|
const luminaTestEntrypointName = "@arcgis/lumina-compiler/testing";
|
|
@@ -154,7 +117,6 @@ export {
|
|
|
154
117
|
checkForLuminaJsx as j,
|
|
155
118
|
isBindThisCallee as k,
|
|
156
119
|
luminaJsxExportName as l,
|
|
157
|
-
makeEslintPlugin as m,
|
|
158
120
|
parsePropertyDecorator as p,
|
|
159
121
|
sourceCodeDeclaresComponent as s,
|
|
160
122
|
unwrapExpression as u
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
2
|
+
const version = "5.2.0-next.51";
|
|
3
|
+
const packageJson = {
|
|
4
|
+
version
|
|
5
|
+
};
|
|
6
|
+
function makeEslintPlugin(pluginName, urlCreator) {
|
|
7
|
+
const rules = [];
|
|
8
|
+
const creator = ESLintUtils.RuleCreator(urlCreator);
|
|
9
|
+
return {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
11
|
+
createRule(rule) {
|
|
12
|
+
const { meta, name, ...rest } = rule;
|
|
13
|
+
const docs = { ...meta.docs, name };
|
|
14
|
+
const ruleModule = creator({ ...rest, meta: { ...meta, docs }, name });
|
|
15
|
+
rules.push(ruleModule);
|
|
16
|
+
return ruleModule;
|
|
17
|
+
},
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
19
|
+
finalize() {
|
|
20
|
+
const config = {
|
|
21
|
+
rules: Object.fromEntries(
|
|
22
|
+
rules.map((rule) => [`${pluginName}/${rule.meta.docs.name}`, rule.meta.docs.defaultLevel])
|
|
23
|
+
)
|
|
24
|
+
};
|
|
25
|
+
const plugin = {
|
|
26
|
+
meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version: packageJson.version },
|
|
27
|
+
configs: {
|
|
28
|
+
recommended: config
|
|
29
|
+
},
|
|
30
|
+
rules: Object.fromEntries(rules.map((rule) => [rule.meta.docs.name, rule]))
|
|
31
|
+
};
|
|
32
|
+
config.plugins = {
|
|
33
|
+
[pluginName]: plugin
|
|
34
|
+
};
|
|
35
|
+
return plugin;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
makeEslintPlugin as m
|
|
41
|
+
};
|