@storm-software/linting-tools 1.0.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.
@@ -0,0 +1,144 @@
1
+ import { fileURLToPath as _fileURLToPath } from 'url';
2
+ import _path from 'node:path';
3
+ import { createRequire as topLevelCreateRequire } from 'module';
4
+ const require = topLevelCreateRequire(import.meta.url);
5
+ const __filename = _fileURLToPath(import.meta.url);
6
+ const __dirname = _path.dirname(__filename);
7
+
8
+ // packages/linting-tools/src/eslint/rules/react.ts
9
+ var config = {
10
+ // We recommend using TypeScript over `prop-types`, as `prop-types` can add
11
+ // to a project's build size.
12
+ "react/prop-types": "off",
13
+ // Disable requiring React to be imported, as this is no longer required.
14
+ "react/react-in-jsx-scope": "off",
15
+ /**
16
+ * Require an explicit type when using button elements.
17
+ *
18
+ * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
19
+ */
20
+ "react/button-has-type": "warn",
21
+ /**
22
+ * Require consistent function type for function components.
23
+ *
24
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md
25
+ */
26
+ "react/function-component-definition": "warn",
27
+ /**
28
+ * Require destructuring and symmetric naming of `useState` hook value and setter variables.
29
+ *
30
+ * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
31
+ */
32
+ "react/hook-use-state": "warn",
33
+ /**
34
+ * Require consistent boolean attributes notation in JSX.
35
+ *
36
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
37
+ */
38
+ "react/jsx-boolean-value": "warn",
39
+ /**
40
+ * Disallow unnecessary curly braces in JSX props and children.
41
+ *
42
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
43
+ */
44
+ "react/jsx-curly-brace-presence": "warn",
45
+ /**
46
+ * Require using shorthand form for React fragments, unless required.
47
+ *
48
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
49
+ */
50
+ "react/jsx-fragments": "warn",
51
+ /**
52
+ * Prevent problematic leaked values from being rendered.
53
+ *
54
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
55
+ */
56
+ "react/jsx-no-leaked-render": "warn",
57
+ /**
58
+ * Prevents usage of unsafe `target='_blank'`.
59
+ *
60
+ * This rule is a part of `react/recommended`, but we've modified it to
61
+ * allow referrer.
62
+ *
63
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
64
+ */
65
+ "react/jsx-no-target-blank": [
66
+ "error",
67
+ {
68
+ allowReferrer: true
69
+ }
70
+ ],
71
+ /**
72
+ * Disallow empty React fragments.
73
+ *
74
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
75
+ */
76
+ "react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
77
+ /**
78
+ * Require the use of PascalCase for user-defined JSX components.
79
+ *
80
+ * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
81
+ */
82
+ "react/jsx-pascal-case": "warn",
83
+ /**
84
+ * Require props to be sorted alphabetically.
85
+ *
86
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
87
+ */
88
+ "react/jsx-sort-props": "warn",
89
+ /**
90
+ * Disallow usage of Array index in keys.
91
+ *
92
+ * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
93
+ */
94
+ "react/no-array-index-key": "warn",
95
+ /**
96
+ * Disallow creating unstable components inside components.
97
+ *
98
+ * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
99
+ */
100
+ "react/no-unstable-nested-components": "error",
101
+ /**
102
+ * Disallow closing tags for components without children.
103
+ *
104
+ * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
105
+ */
106
+ "react/self-closing-comp": "warn"
107
+ };
108
+ var react_default = config;
109
+
110
+ // packages/linting-tools/src/eslint/rules/ts-docs.ts
111
+ var config2 = {
112
+ /**
113
+ * Require TSDoc comments conform to the TSDoc specification.
114
+ *
115
+ * 🚫 Not fixable - https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
116
+ */
117
+ "tsdoc/syntax": "error"
118
+ };
119
+ var ts_docs_default = config2;
120
+
121
+ // packages/linting-tools/src/eslint/react/index.ts
122
+ var config3 = {
123
+ root: true,
124
+ extends: [
125
+ "plugin:react/recommended",
126
+ "plugin:react-hooks/recommended",
127
+ "plugin:jsx-a11y/recommended",
128
+ "plugin:import/react",
129
+ "prettier"
130
+ ],
131
+ settings: {
132
+ react: {
133
+ version: "detect"
134
+ }
135
+ },
136
+ rules: {
137
+ ...ts_docs_default,
138
+ ...react_default
139
+ }
140
+ };
141
+ var react_default2 = config3;
142
+ export {
143
+ react_default2 as default
144
+ };