@azat-io/eslint-config 2.16.0 → 2.18.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.
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { interopDefault } from "../utilities.mjs";
2
+ import { interopDefault } from "../utilities.js";
3
3
  let astro = async (config) => {
4
4
  if (!config.astro) {
5
5
  return {};
@@ -346,8 +346,6 @@ let core = (config) => {
346
346
  "import-x/no-webpack-loader-syntax": "error",
347
347
  "jsdoc/check-access": "error",
348
348
  "jsdoc/check-alignment": "error",
349
- "jsdoc/check-indentation": "error",
350
- "jsdoc/check-line-alignment": "error",
351
349
  "jsdoc/check-param-names": "error",
352
350
  "jsdoc/check-property-names": "error",
353
351
  "jsdoc/check-syntax": "error",
@@ -382,8 +380,6 @@ let core = (config) => {
382
380
  "jsdoc/require-returns-description": "error",
383
381
  "jsdoc/require-returns-type": "error",
384
382
  "jsdoc/require-yields-check": "error",
385
- "jsdoc/sort-tags": "error",
386
- "jsdoc/tag-lines": "error",
387
383
  "jsdoc/valid-types": "error",
388
384
  "prefer-arrow/prefer-arrow-functions": [
389
385
  "error",
package/dist/index.js ADDED
@@ -0,0 +1,63 @@
1
+ import gitignore from "eslint-config-flat-gitignore";
2
+ import { perfectionist } from "./perfectionist/index.js";
3
+ import { packageJson } from "./package-json/index.js";
4
+ import { typescript } from "./typescript/index.js";
5
+ import { svelte } from "./svelte/index.js";
6
+ import { vitest } from "./vitest/index.js";
7
+ import { react } from "./react/index.js";
8
+ import { astro } from "./astro/index.js";
9
+ import { qwik } from "./qwik/index.js";
10
+ import { a11y } from "./a11y/index.js";
11
+ import { core } from "./core/index.js";
12
+ import { node } from "./node/index.js";
13
+ import { vue } from "./vue/index.js";
14
+ const CONFIG_OPTIONS = [
15
+ "perfectionist",
16
+ "typescript",
17
+ "svelte",
18
+ "vitest",
19
+ "astro",
20
+ "react",
21
+ "qwik",
22
+ "node",
23
+ "vue"
24
+ ];
25
+ const index = async ({
26
+ extends: customExtends = {},
27
+ ...rawConfig
28
+ } = {}) => {
29
+ let config = {};
30
+ for (let configName of CONFIG_OPTIONS) {
31
+ config[configName] = rawConfig[configName] ?? false;
32
+ }
33
+ let configFunctions = [
34
+ core,
35
+ a11y,
36
+ react,
37
+ node,
38
+ typescript,
39
+ vitest,
40
+ astro,
41
+ svelte,
42
+ qwik,
43
+ vue,
44
+ packageJson,
45
+ perfectionist
46
+ ];
47
+ let configs = await Promise.all(
48
+ configFunctions.map((createConfigFunction) => createConfigFunction(config))
49
+ );
50
+ return [
51
+ gitignore(),
52
+ ...configs,
53
+ ...Array.isArray(customExtends) ? customExtends : [
54
+ {
55
+ name: "azat-io/custom-extends",
56
+ ...customExtends
57
+ }
58
+ ]
59
+ ];
60
+ };
61
+ export {
62
+ index as default
63
+ };
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let node = async (config) => {
3
3
  if (!config.node) {
4
4
  return {};
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let perfectionist = async (config) => {
3
3
  if (!config.perfectionist) {
4
4
  return {};
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let qwik = async (config) => {
3
3
  if (!config.qwik) {
4
4
  return {};
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let react = async (config) => {
3
3
  if (!config.react) {
4
4
  return {};
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let svelte = async (config) => {
3
3
  if (!config.svelte) {
4
4
  return {};
@@ -55,7 +55,6 @@ let svelte = async (config) => {
55
55
  "svelte/no-dupe-on-directives": "error",
56
56
  "svelte/no-dupe-style-properties": "error",
57
57
  "svelte/no-dupe-use-directives": "error",
58
- "svelte/no-dynamic-slot-name": "error",
59
58
  "svelte/no-extra-reactive-curlies": "error",
60
59
  "svelte/no-ignored-unsubscribe": "error",
61
60
  "svelte/no-immutable-reactive-statements": "error",
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let typescript = async (config) => {
3
3
  if (!config.typescript) {
4
4
  return {};
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let vitest = async (config) => {
3
3
  if (!config.vitest) {
4
4
  return {};
@@ -1,4 +1,4 @@
1
- import { interopDefault } from "../utilities.mjs";
1
+ import { interopDefault } from "../utilities.js";
2
2
  let vue = async (config) => {
3
3
  if (!config.vue) {
4
4
  return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azat-io/eslint-config",
3
- "version": "2.16.0",
3
+ "version": "2.18.0",
4
4
  "description": "ESLint shareable config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -18,8 +18,7 @@
18
18
  "exports": {
19
19
  ".": {
20
20
  "types": "./dist/index.d.ts",
21
- "import": "./dist/index.mjs",
22
- "require": "./dist/index.cjs"
21
+ "import": "./dist/index.js"
23
22
  },
24
23
  "./package.json": "./package.json"
25
24
  },
@@ -28,16 +27,17 @@
28
27
  ],
29
28
  "dependencies": {
30
29
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
31
- "@vitest/eslint-plugin": "1.1.32-beta.3",
30
+ "@vitest/eslint-plugin": "1.1.36",
32
31
  "astro-eslint-parser": "^1.2.1",
32
+ "eslint-config-flat-gitignore": "^2.1.0",
33
33
  "eslint-import-resolver-typescript": "^3.8.3",
34
34
  "eslint-plugin-astro": "^1.3.1",
35
- "eslint-plugin-de-morgan": "^1.1.0",
35
+ "eslint-plugin-de-morgan": "^1.2.0",
36
36
  "eslint-plugin-import-x": "^4.6.1",
37
37
  "eslint-plugin-jsdoc": "^50.6.3",
38
38
  "eslint-plugin-jsx-a11y": "^6.10.2",
39
- "eslint-plugin-n": "^17.15.1",
40
- "eslint-plugin-package-json": "^0.26.0",
39
+ "eslint-plugin-n": "^17.16.1",
40
+ "eslint-plugin-package-json": "^0.26.1",
41
41
  "eslint-plugin-perfectionist": "^4.9.0",
42
42
  "eslint-plugin-prefer-arrow": "^1.2.3",
43
43
  "eslint-plugin-prefer-let": "^4.0.0",
@@ -45,17 +45,17 @@
45
45
  "eslint-plugin-qwik": "^1.12.1",
46
46
  "eslint-plugin-react": "^7.37.4",
47
47
  "eslint-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
48
- "eslint-plugin-react-hooks": "^5.1.0",
48
+ "eslint-plugin-react-hooks": "^5.2.0",
49
49
  "eslint-plugin-react-perf": "^3.3.3",
50
50
  "eslint-plugin-regexp": "^2.7.0",
51
51
  "eslint-plugin-sonarjs": "^3.0.2",
52
- "eslint-plugin-svelte": "^2.46.1",
52
+ "eslint-plugin-svelte": "^3.0.2",
53
53
  "eslint-plugin-unicorn": "^57.0.0",
54
54
  "eslint-plugin-vue": "^9.32.0",
55
55
  "globals": "^16.0.0",
56
56
  "jsonc-eslint-parser": "^2.4.0",
57
- "svelte-eslint-parser": "^0.43.0",
58
- "typescript-eslint": "^8.25.0",
57
+ "svelte-eslint-parser": "^1.0.0",
58
+ "typescript-eslint": "^8.26.0",
59
59
  "vue-eslint-parser": "^9.4.3"
60
60
  },
61
61
  "peerDependencies": {
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxA11y = require("eslint-plugin-jsx-a11y");
4
- let a11y = (config) => {
5
- if (!config.react && !config.qwik) {
6
- return {};
7
- }
8
- let files = ["**/*.jsx"];
9
- if (config.typescript) {
10
- files.push("**/*.tsx");
11
- }
12
- return {
13
- name: "azat-io/a11y/rules",
14
- files,
15
- plugins: {
16
- "jsx-a11y": jsxA11y
17
- },
18
- rules: {
19
- "jsx-a11y/alt-text": "error",
20
- "jsx-a11y/anchor-has-content": "error",
21
- "jsx-a11y/anchor-is-valid": "error",
22
- "jsx-a11y/aria-activedescendant-has-tabindex": "error",
23
- "jsx-a11y/aria-props": "error",
24
- "jsx-a11y/aria-proptypes": "error",
25
- "jsx-a11y/aria-role": "error",
26
- "jsx-a11y/aria-unsupported-elements": "error",
27
- "jsx-a11y/autocomplete-valid": "error",
28
- "jsx-a11y/heading-has-content": "error",
29
- "jsx-a11y/html-has-lang": "error",
30
- "jsx-a11y/iframe-has-title": "error",
31
- "jsx-a11y/img-redundant-alt": "error",
32
- "jsx-a11y/interactive-supports-focus": "error",
33
- "jsx-a11y/label-has-associated-control": "error",
34
- "jsx-a11y/lang": "error",
35
- "jsx-a11y/media-has-caption": "error",
36
- "jsx-a11y/mouse-events-have-key-events": "error",
37
- "jsx-a11y/no-access-key": "error",
38
- "jsx-a11y/no-aria-hidden-on-focusable": "error",
39
- "jsx-a11y/no-autofocus": "error",
40
- "jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
41
- "jsx-a11y/no-noninteractive-element-interactions": "error",
42
- "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
43
- "jsx-a11y/no-noninteractive-tabindex": "error",
44
- "jsx-a11y/no-redundant-roles": "error",
45
- "jsx-a11y/no-static-element-interactions": "error",
46
- "jsx-a11y/prefer-tag-over-role": "error",
47
- "jsx-a11y/role-has-required-aria-props": "error",
48
- "jsx-a11y/role-supports-aria-props": "error",
49
- "jsx-a11y/scope": "error",
50
- "jsx-a11y/tabindex-no-positive": "error"
51
- }
52
- };
53
- };
54
- exports.a11y = a11y;
@@ -1,117 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
18
- mod
19
- ));
20
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
21
- const path = require("node:path");
22
- const utilities = require("../utilities.cjs");
23
- let astro = async (config) => {
24
- if (!config.astro) {
25
- return {};
26
- }
27
- let [astroPlugin, astroParser] = await Promise.all([
28
- utilities.interopDefault(import("eslint-plugin-astro")),
29
- utilities.interopDefault(import("astro-eslint-parser"))
30
- ]);
31
- let files = ["**/*.astro"];
32
- let additionalParserOptions = {};
33
- if (config.typescript) {
34
- let { parser: typescriptParser } = await utilities.interopDefault(
35
- import("typescript-eslint")
36
- );
37
- additionalParserOptions = {
38
- ...additionalParserOptions,
39
- parser: typescriptParser,
40
- project: path.join(process.cwd(), "tsconfig.json"),
41
- projectService: false,
42
- tsconfigRootDir: process.cwd()
43
- };
44
- }
45
- return {
46
- name: "azat-io/astro/rules",
47
- files,
48
- languageOptions: {
49
- parser: astroParser,
50
- parserOptions: {
51
- ecmaVersion: "latest",
52
- extraFileExtensions: [".astro"],
53
- sourceType: "module",
54
- ...additionalParserOptions
55
- }
56
- },
57
- plugins: {
58
- astro: astroPlugin
59
- },
60
- rules: {
61
- "astro/jsx-a11y/alt-text": "error",
62
- "astro/jsx-a11y/anchor-has-content": "error",
63
- "astro/jsx-a11y/anchor-is-valid": "error",
64
- "astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
65
- "astro/jsx-a11y/aria-props": "error",
66
- "astro/jsx-a11y/aria-proptypes": "error",
67
- "astro/jsx-a11y/aria-role": "error",
68
- "astro/jsx-a11y/aria-unsupported-elements": "error",
69
- "astro/jsx-a11y/autocomplete-valid": "error",
70
- "astro/jsx-a11y/heading-has-content": "error",
71
- "astro/jsx-a11y/html-has-lang": "error",
72
- "astro/jsx-a11y/iframe-has-title": "error",
73
- "astro/jsx-a11y/img-redundant-alt": "error",
74
- "astro/jsx-a11y/interactive-supports-focus": "error",
75
- "astro/jsx-a11y/label-has-associated-control": "error",
76
- "astro/jsx-a11y/lang": "error",
77
- "astro/jsx-a11y/media-has-caption": "error",
78
- "astro/jsx-a11y/mouse-events-have-key-events": "error",
79
- "astro/jsx-a11y/no-access-key": "error",
80
- "astro/jsx-a11y/no-aria-hidden-on-focusable": "error",
81
- "astro/jsx-a11y/no-autofocus": "error",
82
- "astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
83
- "astro/jsx-a11y/no-noninteractive-element-interactions": "error",
84
- "astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
85
- "astro/jsx-a11y/no-noninteractive-tabindex": "error",
86
- "astro/jsx-a11y/no-redundant-roles": "error",
87
- "astro/jsx-a11y/no-static-element-interactions": "error",
88
- "astro/jsx-a11y/prefer-tag-over-role": "error",
89
- "astro/jsx-a11y/role-has-required-aria-props": "error",
90
- "astro/jsx-a11y/role-supports-aria-props": "error",
91
- "astro/jsx-a11y/scope": "error",
92
- "astro/jsx-a11y/tabindex-no-positive": "error",
93
- "astro/missing-client-only-directive-value": "error",
94
- "astro/no-conflict-set-directives": "error",
95
- "astro/no-deprecated-astro-canonicalurl": "error",
96
- "astro/no-deprecated-astro-fetchcontent": "error",
97
- "astro/no-deprecated-astro-resolve": "error",
98
- "astro/no-deprecated-getentrybyslug": "error",
99
- "astro/no-exports-from-components": "error",
100
- "astro/no-set-text-directive": "error",
101
- "astro/no-unused-define-vars-in-style": "error",
102
- "astro/prefer-class-list-directive": "error",
103
- "astro/prefer-object-class-list": "error",
104
- "astro/prefer-split-class-list": "error",
105
- "astro/sort-attributes": [
106
- "error",
107
- {
108
- ignoreCase: true,
109
- order: "desc",
110
- type: "line-length"
111
- }
112
- ],
113
- "astro/valid-compile": "error"
114
- }
115
- };
116
- };
117
- exports.astro = astro;