-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
68 lines (63 loc) · 1.94 KB
/
Copy patheslint.config.mjs
File metadata and controls
68 lines (63 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// SPDX-FileCopyrightText: 2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)
// SPDX-License-Identifier: Apache-2.0
import js from "@eslint/js";
import globals from "globals";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import tseslint from "typescript-eslint";
import prettier from "eslint-config-prettier";
export default tseslint.config(
{
ignores: ["dist/", "node_modules/", "example/"],
},
// Library source and tests (JavaScript + JSX).
{
files: ["src/**/*.{js,jsx}"],
...js.configs.recommended,
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: globals.browser,
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
plugins: {
react,
"react-hooks": reactHooks,
},
settings: {
react: { version: "detect" },
},
rules: {
...react.configs.flat.recommended.rules,
...reactHooks.configs.recommended.rules,
// The automatic JSX runtime does not require React in scope.
"react/react-in-jsx-scope": "off",
// The plugin wraps swagger-ui components whose props come from an
// untyped Immutable.js data model, so PropTypes validation and display
// names on the anonymous wrapper HOCs add noise without value.
"react/prop-types": "off",
"react/display-name": "off",
},
},
// TypeScript declaration and config files.
{
files: ["**/*.ts"],
extends: [tseslint.configs.recommended],
rules: {
// The hand-written declarations mirror swagger-ui's untyped plugin API,
// where `any` is the accurate shape for wrapped components.
"@typescript-eslint/no-explicit-any": "off",
},
},
// Node-based config and setup files.
{
files: ["*.config.{ts,mjs}", "vitest.setup.js"],
languageOptions: {
globals: globals.node,
},
},
// Disable stylistic rules handled by Prettier. Must stay last.
prettier
);