@qlik/eslint-config 1.4.29 → 2.0.0-next.1

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.
@@ -1,11 +0,0 @@
1
- // @ts-check
2
-
3
- /**
4
- * @satisfies {import("../../types/index.js").ESLintFlatConfig["rules"]}
5
- * Svelte plugin https://sveltejs.github.io/eslint-plugin-svelte/rules/
6
- */
7
- const rules = {
8
- // Override rules here
9
- };
10
-
11
- export default rules;
@@ -1,56 +0,0 @@
1
- // @ts-check
2
- import prettier from "eslint-config-prettier";
3
- import eslintPluginSvelte from "eslint-plugin-svelte";
4
- import svelteParser from "svelte-eslint-parser";
5
- import tsEslint from "typescript-eslint";
6
- import { mergeConfigs } from "../utils/config.js";
7
- import { recommendedJS, recommendedTS } from "./recommended.js";
8
- import svelteRules from "./rules/svelte.js";
9
-
10
- /**
11
- * @type {import("../types/index.js").ESLintFlatConfig}
12
- * config for Svelte https://github.com/sveltejs/eslint-plugin-svelte
13
- */
14
- const svelteJS = mergeConfigs(
15
- // base it on svelte plugin recommended config
16
- ...eslintPluginSvelte.configs["flat/recommended"],
17
- // add qlik's recommended svelte config
18
- {
19
- name: "svelte",
20
- files: ["**/*.svelte"],
21
- languageOptions: {
22
- parser: svelteParser,
23
- parserOptions: {
24
- parser: tsEslint.parser,
25
- extraFileExtensions: [".svelte"],
26
- },
27
- },
28
- rules: {
29
- ...svelteRules,
30
- // modify rules from eslint-plugin-svelte here
31
-
32
- // Conflicting rules
33
- // https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/OTHER_PLUGINS.md
34
- "import-x/first": "off",
35
- "import-x/no-duplicates": "off",
36
- "import-x/no-mutable-exports": "off",
37
- "import-x/no-unresolved": "off",
38
- "import-x/prefer-default-export": "off",
39
- "import-x/extensions": "off",
40
-
41
- // Issues with TypeScript rules
42
- "@typescript-eslint/no-unsafe-call": "off",
43
- "@typescript-eslint/no-unsafe-return": "off",
44
- "@typescript-eslint/no-unsafe-argument": "off",
45
- "@typescript-eslint/no-unsafe-assignment": "off",
46
- "@typescript-eslint/no-unsafe-member-access": "off",
47
-
48
- // Issues with function types that define parameters
49
- "no-unused-vars": "off",
50
- },
51
- },
52
- prettier,
53
- );
54
-
55
- export default [recommendedJS, recommendedTS, svelteJS];
56
- export { svelteJS };
@@ -1,63 +0,0 @@
1
- // @ts-check
2
-
3
- import { mergeConfigs } from "./config.js";
4
-
5
- /**
6
- * Utility function to make it easy to strictly type your "Flat" config file
7
- *
8
- * @param {...(import("../types/index.js").ESLintFlatConfigWithExtend)} configs
9
- * @returns {import("../types/index.js").ESLintFlatConfig[]}
10
- *
11
- * @example
12
- * ```js
13
- * import qlik from "@qlik/eslint-config";
14
- *
15
- * export default qlik.compose(
16
- * ...qlik.configs.react,
17
- * ...qlik.configs.vitest,
18
- * {
19
- * rules: {
20
- * // Override rules if needed
21
- * },
22
- * },
23
- * // In its own object so it's global
24
- * {
25
- * ignores: ["dist", "node_modules", "script"],
26
- * },
27
- * );
28
- * ```
29
- */
30
- export default function compose(...configs) {
31
- return configs.flatMap((configWithExtends, configIndex) => {
32
- const { extend: extendArr, ...config } = configWithExtends;
33
- if (extendArr && !Array.isArray(extendArr)) {
34
- throw new Error("extend property must be an array");
35
- }
36
- if (extendArr == null || extendArr.length === 0) {
37
- return config;
38
- }
39
-
40
- const undefinedExtensions = extendArr.reduce((acc, extension, extensionIndex) => {
41
- const maybeExtension = extension;
42
- if (maybeExtension == null) {
43
- acc.push(extensionIndex);
44
- }
45
- return acc;
46
- }, /** @type {number[]} */ ([]));
47
- if (undefinedExtensions.length) {
48
- const configName = configWithExtends.name != null ? `, named "${configWithExtends.name}",` : " (anonymous)";
49
- const extensionIndices = undefinedExtensions.join(", ");
50
- throw new Error(
51
- `Your config at index ${configIndex}${configName} contains undefined` +
52
- ` extensions at the following indices: ${extensionIndices}.`,
53
- );
54
- }
55
-
56
- return [
57
- ...extendArr.map((extension) => {
58
- const name = [config.name, extension.name].filter(Boolean).join("__");
59
- return mergeConfigs(extension, config, name ? { name } : {});
60
- }),
61
- ];
62
- });
63
- }