@azat-io/eslint-config 2.96.0 → 2.96.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,9 +1,11 @@
1
1
  import jsxA11y from "eslint-plugin-jsx-a11y";
2
2
  function a11y(config) {
3
3
  if (!config.react && !config.qwik) return {};
4
+ let files = ["**/*.jsx"];
5
+ if (config.typescript) files.push("**/*.tsx");
4
6
  return {
5
7
  name: "azat-io/a11y/rules",
6
- files: ["**/*.jsx", ...config.typescript ? ["**/*.tsx"] : []],
8
+ files,
7
9
  plugins: { "jsx-a11y": jsxA11y },
8
10
  rules: {
9
11
  "jsx-a11y/alt-text": "error",
@@ -10,22 +10,22 @@ import jsdocPlugin from "eslint-plugin-jsdoc";
10
10
  import slopPlugin from "eslint-plugin-slop";
11
11
  import globals from "globals";
12
12
  function core(config) {
13
+ let files = [
14
+ "**/*.js",
15
+ "**/*.cjs",
16
+ "**/*.mjs"
17
+ ];
18
+ if (config.typescript) files.push("**/*.ts", "**/*.cts", "**/*.mts");
19
+ if (config.react || config.qwik) {
20
+ files.push("**/*.jsx");
21
+ if (config.typescript) files.push("**/*.tsx");
22
+ }
23
+ if (config.astro) files.push("**/*.astro");
24
+ if (config.svelte) files.push("**/*.svelte");
25
+ if (config.vue) files.push("**/*.vue");
13
26
  return {
14
27
  name: "azat-io/core/rules",
15
- files: [
16
- "**/*.js",
17
- "**/*.cjs",
18
- "**/*.mjs",
19
- ...config.typescript ? [
20
- "**/*.ts",
21
- "**/*.cts",
22
- "**/*.mts"
23
- ] : [],
24
- ...config.react || config.qwik ? ["**/*.jsx", ...config.typescript ? ["**/*.tsx"] : []] : [],
25
- ...config.astro ? ["**/*.astro"] : [],
26
- ...config.svelte ? ["**/*.svelte"] : [],
27
- ...config.vue ? ["**/*.vue"] : []
28
- ],
28
+ files,
29
29
  languageOptions: {
30
30
  globals: {
31
31
  ...globals.browser,
@@ -502,7 +502,6 @@ function core(config) {
502
502
  "unicorn/no-exports-in-scripts": "error",
503
503
  "unicorn/no-for-each": "error",
504
504
  "unicorn/no-for-loop": "error",
505
- "unicorn/no-immediate-mutation": "error",
506
505
  "unicorn/no-impossible-length-comparison": "error",
507
506
  "unicorn/no-incorrect-query-selector": "error",
508
507
  "unicorn/no-instanceof-builtins": "error",
@@ -600,7 +599,6 @@ function core(config) {
600
599
  "unicorn/prefer-boolean-return": "error",
601
600
  "unicorn/prefer-class-fields": "error",
602
601
  "unicorn/prefer-classlist-toggle": "error",
603
- "unicorn/prefer-combined-guards": "error",
604
602
  "unicorn/prefer-date-now": "error",
605
603
  "unicorn/prefer-default-parameters": "error",
606
604
  "unicorn/prefer-direct-iteration": "error",
@@ -2,22 +2,22 @@ import { interopDefault } from "../utilities.js";
2
2
  async function node(config) {
3
3
  if (!config.node) return {};
4
4
  let nodePlugin = await interopDefault(import("eslint-plugin-n"));
5
+ let files = [
6
+ "**/*.js",
7
+ "**/*.cjs",
8
+ "**/*.mjs"
9
+ ];
10
+ if (config.typescript) files.push("**/*.ts", "**/*.cts", "**/*.mts");
11
+ if (config.react || config.qwik) {
12
+ files.push("**/*.jsx");
13
+ if (config.typescript) files.push("**/*.tsx");
14
+ }
15
+ if (config.astro) files.push("**/*.astro");
16
+ if (config.svelte) files.push("**/*.svelte");
17
+ if (config.vue) files.push("**/*.vue");
5
18
  return {
6
19
  name: "azat-io/node/rules",
7
- files: [
8
- "**/*.js",
9
- "**/*.cjs",
10
- "**/*.mjs",
11
- ...config.typescript ? [
12
- "**/*.ts",
13
- "**/*.cts",
14
- "**/*.mts"
15
- ] : [],
16
- ...config.react || config.qwik ? ["**/*.jsx", ...config.typescript ? ["**/*.tsx"] : []] : [],
17
- ...config.astro ? ["**/*.astro"] : [],
18
- ...config.svelte ? ["**/*.svelte"] : [],
19
- ...config.vue ? ["**/*.vue"] : []
20
- ],
20
+ files,
21
21
  plugins: { node: nodePlugin },
22
22
  rules: {
23
23
  "node/handle-callback-err": ["error", "error"],
@@ -2,22 +2,22 @@ import { interopDefault } from "../utilities.js";
2
2
  async function perfectionist(config) {
3
3
  if (!config.perfectionist) return {};
4
4
  let perfectionistPlugin = await interopDefault(import("eslint-plugin-perfectionist"));
5
+ let files = [
6
+ "**/*.js",
7
+ "**/*.cjs",
8
+ "**/*.mjs"
9
+ ];
10
+ if (config.typescript) files.push("**/*.ts", "**/*.cts", "**/*.mts");
11
+ if (config.react || config.qwik) {
12
+ files.push("**/*.jsx");
13
+ if (config.typescript) files.push("**/*.tsx");
14
+ }
15
+ if (config.astro) files.push("**/*.astro");
16
+ if (config.svelte) files.push("**/*.svelte");
17
+ if (config.vue) files.push("**/*.vue");
5
18
  return {
6
19
  name: "azat-io/perfectionist/rules",
7
- files: [
8
- "**/*.js",
9
- "**/*.cjs",
10
- "**/*.mjs",
11
- ...config.typescript ? [
12
- "**/*.ts",
13
- "**/*.cts",
14
- "**/*.mts"
15
- ] : [],
16
- ...config.react || config.qwik ? ["**/*.jsx", ...config.typescript ? ["**/*.tsx"] : []] : [],
17
- ...config.astro ? ["**/*.astro"] : [],
18
- ...config.svelte ? ["**/*.svelte"] : [],
19
- ...config.vue ? ["**/*.vue"] : []
20
- ],
20
+ files,
21
21
  plugins: { perfectionist: perfectionistPlugin },
22
22
  rules: {
23
23
  "perfectionist/sort-array-includes": ["error"],
@@ -2,9 +2,11 @@ import { interopDefault } from "../utilities.js";
2
2
  async function qwik(config) {
3
3
  if (!config.qwik) return {};
4
4
  let qwikPlugin = await interopDefault(import("eslint-plugin-qwik"));
5
+ let files = ["**/*.jsx"];
6
+ if (config.typescript) files.push("**/*.tsx");
5
7
  return {
6
8
  name: "azat-io/qwik/rules",
7
- files: ["**/*.jsx", ...config.typescript ? ["**/*.tsx"] : []],
9
+ files,
8
10
  plugins: { qwik: qwikPlugin },
9
11
  rules: {
10
12
  "qwik/jsx-a": "error",
@@ -11,9 +11,11 @@ async function react(config) {
11
11
  interopDefault(import("eslint-plugin-react-web-api")),
12
12
  interopDefault(import("eslint-plugin-react-x"))
13
13
  ]);
14
+ let files = ["**/*.jsx"];
15
+ if (config.typescript) files.push("**/*.tsx");
14
16
  return {
15
17
  name: "azat-io/react/rules",
16
- files: ["**/*.jsx", ...config.typescript ? ["**/*.tsx"] : []],
18
+ files,
17
19
  plugins: {
18
20
  "react-compiler": reactCompilerPlugin,
19
21
  "react-dom": reactDomPlugin,
@@ -2,17 +2,18 @@ import { interopDefault } from "../utilities.js";
2
2
  async function typescript(config) {
3
3
  if (!config.typescript) return {};
4
4
  let { parser: typescriptParser, plugin: typescriptPlugin } = await interopDefault(import("typescript-eslint"));
5
+ let files = [
6
+ "**/*.ts",
7
+ "**/*.cts",
8
+ "**/*.mts"
9
+ ];
10
+ if (config.react || config.qwik) files.push("**/*.tsx");
11
+ if (config.astro) files.push("**/*.astro");
12
+ if (config.svelte) files.push("**/*.svelte");
13
+ if (config.vue) files.push("**/*.vue");
5
14
  return {
6
15
  name: "azat-io/typescript/rules",
7
- files: [
8
- "**/*.ts",
9
- "**/*.cts",
10
- "**/*.mts",
11
- ...config.react || config.qwik ? ["**/*.tsx"] : [],
12
- ...config.astro ? ["**/*.astro"] : [],
13
- ...config.svelte ? ["**/*.svelte"] : [],
14
- ...config.vue ? ["**/*.vue"] : []
15
- ],
16
+ files,
16
17
  languageOptions: {
17
18
  parser: typescriptParser,
18
19
  parserOptions: {
@@ -2,29 +2,22 @@ import { interopDefault } from "../utilities.js";
2
2
  async function vitest(config) {
3
3
  if (!config.vitest) return {};
4
4
  let vitestPlugin = await interopDefault(import("@vitest/eslint-plugin"));
5
+ let files = [
6
+ "**/test/*.js",
7
+ "**/test/*.cjs",
8
+ "**/test/*.mjs",
9
+ "**/*.test.js",
10
+ "**/*.test.cjs",
11
+ "**/*.test.mjs"
12
+ ];
13
+ if (config.typescript) files.push("**/test/*.ts", "**/test/*.cts", "**/test/*.mts", "**/*.test.ts", "**/*.test.cts", "**/*.test.mts");
14
+ if (config.react || config.qwik) {
15
+ files.push("**/test/*.jsx", "**/*.test.jsx");
16
+ if (config.typescript) files.push("**/test/*.tsx", "**/*.test.tsx");
17
+ }
5
18
  return {
6
19
  name: "azat-io/vitest/rules",
7
- files: [
8
- "**/test/*.js",
9
- "**/test/*.cjs",
10
- "**/test/*.mjs",
11
- "**/*.test.js",
12
- "**/*.test.cjs",
13
- "**/*.test.mjs",
14
- ...config.typescript ? [
15
- "**/test/*.ts",
16
- "**/test/*.cts",
17
- "**/test/*.mts",
18
- "**/*.test.ts",
19
- "**/*.test.cts",
20
- "**/*.test.mts"
21
- ] : [],
22
- ...config.react || config.qwik ? [
23
- "**/test/*.jsx",
24
- "**/*.test.jsx",
25
- ...config.typescript ? ["**/test/*.tsx", "**/*.test.tsx"] : []
26
- ] : []
27
- ],
20
+ files,
28
21
  plugins: { vitest: vitestPlugin },
29
22
  rules: {
30
23
  "vitest/consistent-each-for": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azat-io/eslint-config",
3
- "version": "2.96.0",
3
+ "version": "2.96.1",
4
4
  "description": "ESLint shareable config",
5
5
  "keywords": [
6
6
  "eslint",