@newsteam/eslint-config 1.2.15 → 1.2.17

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.
Files changed (150) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -52
  4. package/dist/plugins/sort-react-dependency-arrays.d.ts +3 -2
  5. package/dist/plugins/sort-react-dependency-arrays.d.ts.map +1 -1
  6. package/dist/plugins/sort-react-dependency-arrays.js +95 -18
  7. package/dist/rules/array-function.d.ts +3 -0
  8. package/dist/rules/array-function.d.ts.map +1 -0
  9. package/dist/rules/array-function.js +56 -0
  10. package/dist/rules/css-modules.d.ts +3 -0
  11. package/dist/rules/css-modules.d.ts.map +1 -0
  12. package/dist/rules/css-modules.js +27 -0
  13. package/dist/rules/destructuring.d.ts +3 -0
  14. package/dist/rules/destructuring.d.ts.map +1 -0
  15. package/dist/rules/destructuring.js +39 -0
  16. package/dist/rules/eslint-comments.d.ts +3 -0
  17. package/dist/rules/eslint-comments.d.ts.map +1 -0
  18. package/dist/rules/eslint-comments.js +77 -0
  19. package/dist/rules/import-newlines.d.ts +3 -0
  20. package/dist/rules/import-newlines.d.ts.map +1 -0
  21. package/dist/rules/import-newlines.js +26 -0
  22. package/dist/rules/import-x.d.ts +3 -0
  23. package/dist/rules/import-x.d.ts.map +1 -0
  24. package/dist/rules/import-x.js +420 -0
  25. package/dist/{rules.d.ts → rules/index.d.ts} +1 -1
  26. package/dist/rules/index.d.ts.map +1 -0
  27. package/dist/{rules.js → rules/index.js} +51 -1
  28. package/dist/rules/next.d.ts +3 -0
  29. package/dist/rules/next.d.ts.map +1 -0
  30. package/dist/rules/next.js +140 -0
  31. package/dist/rules/no-unsanitized.d.ts +3 -0
  32. package/dist/rules/no-unsanitized.d.ts.map +1 -0
  33. package/dist/rules/no-unsanitized.js +38 -0
  34. package/dist/rules/no-useless-assign.d.ts +3 -0
  35. package/dist/rules/no-useless-assign.d.ts.map +1 -0
  36. package/dist/rules/no-useless-assign.js +20 -0
  37. package/dist/rules/node.d.ts +3 -0
  38. package/dist/rules/node.d.ts.map +1 -0
  39. package/dist/rules/node.js +305 -0
  40. package/dist/rules/perfectionist.d.ts +3 -0
  41. package/dist/rules/perfectionist.d.ts.map +1 -0
  42. package/dist/rules/perfectionist.js +94 -0
  43. package/dist/rules/promise.d.ts +3 -0
  44. package/dist/rules/promise.d.ts.map +1 -0
  45. package/dist/rules/promise.js +123 -0
  46. package/dist/rules/react-19-upgrade.d.ts +3 -0
  47. package/dist/rules/react-19-upgrade.d.ts.map +1 -0
  48. package/dist/rules/react-19-upgrade.js +20 -0
  49. package/dist/rules/react-compiler.d.ts +3 -0
  50. package/dist/rules/react-compiler.d.ts.map +1 -0
  51. package/dist/{plugins → rules}/react-compiler.js +7 -9
  52. package/dist/rules/react-hooks.d.ts +3 -0
  53. package/dist/rules/react-hooks.d.ts.map +1 -0
  54. package/dist/rules/react-hooks.js +163 -0
  55. package/dist/rules/react-perf.d.ts +3 -0
  56. package/dist/rules/react-perf.d.ts.map +1 -0
  57. package/dist/rules/react-perf.js +47 -0
  58. package/dist/rules/react-refresh.d.ts +3 -0
  59. package/dist/rules/react-refresh.d.ts.map +1 -0
  60. package/dist/rules/react-refresh.js +19 -0
  61. package/dist/rules/react.d.ts +3 -0
  62. package/dist/rules/react.d.ts.map +1 -0
  63. package/dist/rules/react.js +740 -0
  64. package/dist/rules/security.d.ts +3 -0
  65. package/dist/rules/security.d.ts.map +1 -0
  66. package/dist/rules/security.js +112 -0
  67. package/dist/rules/sort-react-dependency-arrays.d.ts +3 -0
  68. package/dist/rules/sort-react-dependency-arrays.d.ts.map +1 -0
  69. package/dist/rules/sort-react-dependency-arrays.js +12 -0
  70. package/dist/rules/stylistic.d.ts +3 -0
  71. package/dist/rules/stylistic.d.ts.map +1 -0
  72. package/dist/rules/stylistic.js +916 -0
  73. package/dist/rules/typescript.d.ts +3 -0
  74. package/dist/rules/typescript.d.ts.map +1 -0
  75. package/dist/{plugins → rules}/typescript.js +2 -1
  76. package/dist/rules/unicorn.d.ts +3 -0
  77. package/dist/rules/unicorn.d.ts.map +1 -0
  78. package/dist/rules/unicorn.js +998 -0
  79. package/dist/test/index.d.ts +2 -0
  80. package/dist/test/index.d.ts.map +1 -0
  81. package/dist/test/index.js +15 -0
  82. package/package.json +11 -13
  83. package/dist/plugins/array-function.d.ts +0 -3
  84. package/dist/plugins/array-function.d.ts.map +0 -1
  85. package/dist/plugins/array-function.js +0 -58
  86. package/dist/plugins/css-modules.d.ts +0 -3
  87. package/dist/plugins/css-modules.d.ts.map +0 -1
  88. package/dist/plugins/css-modules.js +0 -19
  89. package/dist/plugins/destructuring.d.ts +0 -3
  90. package/dist/plugins/destructuring.d.ts.map +0 -1
  91. package/dist/plugins/destructuring.js +0 -41
  92. package/dist/plugins/eslint-comments.d.ts +0 -3
  93. package/dist/plugins/eslint-comments.d.ts.map +0 -1
  94. package/dist/plugins/eslint-comments.js +0 -79
  95. package/dist/plugins/import-newlines.d.ts +0 -3
  96. package/dist/plugins/import-newlines.d.ts.map +0 -1
  97. package/dist/plugins/import-newlines.js +0 -28
  98. package/dist/plugins/import-x.d.ts +0 -3
  99. package/dist/plugins/import-x.d.ts.map +0 -1
  100. package/dist/plugins/import-x.js +0 -418
  101. package/dist/plugins/newline-destructuring.d.ts +0 -3
  102. package/dist/plugins/newline-destructuring.d.ts.map +0 -1
  103. package/dist/plugins/newline-destructuring.js +0 -26
  104. package/dist/plugins/next.d.ts +0 -3
  105. package/dist/plugins/next.d.ts.map +0 -1
  106. package/dist/plugins/next.js +0 -142
  107. package/dist/plugins/no-unsanitized.d.ts +0 -3
  108. package/dist/plugins/no-unsanitized.d.ts.map +0 -1
  109. package/dist/plugins/no-unsanitized.js +0 -40
  110. package/dist/plugins/no-useless-assign.d.ts +0 -3
  111. package/dist/plugins/no-useless-assign.d.ts.map +0 -1
  112. package/dist/plugins/no-useless-assign.js +0 -22
  113. package/dist/plugins/node.d.ts +0 -3
  114. package/dist/plugins/node.d.ts.map +0 -1
  115. package/dist/plugins/node.js +0 -307
  116. package/dist/plugins/perfectionist.d.ts +0 -3
  117. package/dist/plugins/perfectionist.d.ts.map +0 -1
  118. package/dist/plugins/perfectionist.js +0 -96
  119. package/dist/plugins/promise.d.ts +0 -3
  120. package/dist/plugins/promise.d.ts.map +0 -1
  121. package/dist/plugins/promise.js +0 -125
  122. package/dist/plugins/react-19-upgrade.d.ts +0 -3
  123. package/dist/plugins/react-19-upgrade.d.ts.map +0 -1
  124. package/dist/plugins/react-19-upgrade.js +0 -22
  125. package/dist/plugins/react-compiler.d.ts +0 -3
  126. package/dist/plugins/react-compiler.d.ts.map +0 -1
  127. package/dist/plugins/react-hooks.d.ts +0 -3
  128. package/dist/plugins/react-hooks.d.ts.map +0 -1
  129. package/dist/plugins/react-hooks.js +0 -165
  130. package/dist/plugins/react-perf.d.ts +0 -3
  131. package/dist/plugins/react-perf.d.ts.map +0 -1
  132. package/dist/plugins/react-perf.js +0 -49
  133. package/dist/plugins/react-refresh.d.ts +0 -3
  134. package/dist/plugins/react-refresh.d.ts.map +0 -1
  135. package/dist/plugins/react-refresh.js +0 -21
  136. package/dist/plugins/react.d.ts +0 -3
  137. package/dist/plugins/react.d.ts.map +0 -1
  138. package/dist/plugins/react.js +0 -738
  139. package/dist/plugins/security.d.ts +0 -3
  140. package/dist/plugins/security.d.ts.map +0 -1
  141. package/dist/plugins/security.js +0 -114
  142. package/dist/plugins/stylistic.d.ts +0 -3
  143. package/dist/plugins/stylistic.d.ts.map +0 -1
  144. package/dist/plugins/stylistic.js +0 -901
  145. package/dist/plugins/typescript.d.ts +0 -3
  146. package/dist/plugins/typescript.d.ts.map +0 -1
  147. package/dist/plugins/unicorn.d.ts +0 -3
  148. package/dist/plugins/unicorn.d.ts.map +0 -1
  149. package/dist/plugins/unicorn.js +0 -994
  150. package/dist/rules.d.ts.map +0 -1
@@ -1,165 +0,0 @@
1
- import reactHooks from "eslint-plugin-react-hooks";
2
- /*
3
- * This ESLint plugin enforces the Rules of Hooks.
4
- *
5
- * It is a part of the Hooks API for React.
6
- *
7
- * https://www.npmjs.com/package/eslint-plugin-react-hooks
8
- * https://reactjs.org/docs/hooks-rules.html
9
- */
10
- export const reactHooksPlugin = [
11
- {
12
- plugins: {
13
- "react-hooks": reactHooks,
14
- },
15
- rules: {
16
- /*
17
- * Verifies that automatic effect dependencies are compiled if opted-in
18
- */
19
- "react-hooks/automatic-effect-dependencies": "warn",
20
- /*
21
- * Validates against calling capitalized functions/methods instead of using JSX
22
- */
23
- "react-hooks/capitalized-calls": "warn",
24
- /*
25
- * Validates against higher order functions defining nested components or hooks.
26
- * Components and hooks should be defined at the module level
27
- */
28
- "react-hooks/component-hook-factories": "warn",
29
- /*
30
- * Validates the compiler configuration options
31
- */
32
- "react-hooks/config": "warn",
33
- /*
34
- * Validates usage of error boundaries instead of try/catch for errors in child components
35
- */
36
- "react-hooks/error-boundaries": "warn",
37
- /*
38
- * Checks effect dependencies
39
- *
40
- * This is off because it doesn't always make sense to list all dependencies
41
- */
42
- // TODO (this should be turned on eventually)
43
- "react-hooks/exhaustive-deps": "off",
44
- /*
45
- * Validates usage of fbt
46
- *
47
- * We don't use fbt
48
- */
49
- "react-hooks/fbt": "off",
50
- /*
51
- * Validates usage of `fire`
52
- *
53
- * We don't use fire
54
- */
55
- "react-hooks/fire": "off",
56
- /*
57
- * Validates configuration of
58
- *
59
- * We don't use gating
60
- *
61
- * https://react.dev/reference/react-compiler/gating
62
- */
63
- "react-hooks/gating": "off",
64
- /*
65
- * Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)
66
- */
67
- "react-hooks/globals": "warn",
68
- /*
69
- * Validates the rules of hooks
70
- */
71
- "react-hooks/hooks": "warn",
72
- /*
73
- * Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)
74
- */
75
- "react-hooks/immutability": "warn",
76
- /*
77
- * Validates against usage of libraries which are incompatible with memoization (manual or automatic)
78
- */
79
- "react-hooks/incompatible-library": "warn",
80
- /*
81
- * Internal invariants
82
- */
83
- "react-hooks/invariant": "warn",
84
- /*
85
- * Validates that effect dependencies are memoized
86
- */
87
- "react-hooks/memoized-effect-dependencies": "warn",
88
- /*
89
- * Checks for unnessessary setState calls in useEffect hooks
90
- *
91
- * https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state
92
- */
93
- "react-hooks/no-deriving-state-in-effects": "warn",
94
- // Apprently this doesn't exist anymore
95
- // "react-hooks/no-unused-directives": "warn",
96
- /*
97
- * Validates that existing manual memoized is preserved by the compiler.
98
- * React Compiler will only compile components and hooks if its inference
99
- *
100
- * https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo
101
- *
102
- */
103
- // TODO (this should be turned on eventually)
104
- "react-hooks/preserve-manual-memoization": "off",
105
- /*
106
- * Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions
107
- */
108
- "react-hooks/purity": "warn",
109
- /*
110
- * Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
111
- *
112
- * see https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
113
- */
114
- "react-hooks/refs": "warn",
115
- /*
116
- * Validates against suppression of other rules
117
- *
118
- * Yeah we can suppress without having to do it twice
119
- */
120
- "react-hooks/rule-suppression": "off",
121
- /*
122
- * Validates the rules of hooks
123
- */
124
- "react-hooks/rules-of-hooks": "warn",
125
- /*
126
- * Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
127
- */
128
- // TODO (this should be turned on eventually)
129
- "react-hooks/set-state-in-effect": "off",
130
- /*
131
- * Validates against setting state during render, which can trigger additional renders and potential infinite render loops
132
- */
133
- "react-hooks/set-state-in-render": "warn",
134
- /*
135
- * Validates that components are static, not recreated every render.
136
- * Components that are recreated dynamically can reset state and trigger excessive re-rendering
137
- */
138
- "react-hooks/static-components": "warn",
139
- /*
140
- * Validates against invalid syntax
141
- */
142
- "react-hooks/syntax": "warn",
143
- /*
144
- * Unimplemented features
145
- *
146
- * It's unclear what this does, leaving it off
147
- */
148
- "react-hooks/todo": "off",
149
- /*
150
- * Validates against syntax that we do not plan to support in React Compiler
151
- */
152
- "react-hooks/unsupported-syntax": "warn",
153
- /*
154
- * Validates usage of the useMemo() hook against common mistakes.
155
- *
156
- * https://react.dev/reference/react/useMemo
157
- */
158
- "react-hooks/use-memo": "warn",
159
- /*
160
- * Validates that useMemos always return a value. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
161
- */
162
- "react-hooks/void-use-memo": "warn",
163
- },
164
- },
165
- ];
@@ -1,3 +0,0 @@
1
- import type { Linter } from "eslint";
2
- export declare const reactPerfPlugin: Linter.Config[];
3
- //# sourceMappingURL=react-perf.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-perf.d.ts","sourceRoot":"","sources":["../../src/plugins/react-perf.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EA8C1C,CAAC"}
@@ -1,49 +0,0 @@
1
- import { fixupPluginRules } from "@eslint/compat";
2
- import reactPerf from "eslint-plugin-react-perf";
3
- /*
4
- * Performance-minded React linting rules for ESLint motivated by esamatti's
5
- * post "React.js pure render performance anti-pattern".
6
- * https://medium.com/@esamatti/react-js-pure-render-performance-anti-pattern-fb88c101332f
7
- *
8
- * https://www.npmjs.com/package/eslint-plugin-react-perf
9
- */
10
- export const reactPerfPlugin = [
11
- {
12
- plugins: {
13
- "react-perf": fixupPluginRules(reactPerf),
14
- },
15
- rules: {
16
- /*
17
- * Prevent JSX that are local to the current method from being used as values of JSX props
18
- *
19
- * We're unwilling to turn this on since it's a pretty common pattern and
20
- * we're not convinced it'll make a noticable difference.
21
- *
22
- * https://github.com/cvazac/eslint-plugin-react-perf/blob/HEAD/docs/rules/jsx-no-jsx-as-prop.md
23
- */
24
- "react-perf/jsx-no-jsx-as-prop": "off",
25
- /*
26
- * Prevent Arrays that are local to the current method from being used as values of JSX props
27
- *
28
- * So common that we do this it's annoying
29
- *
30
- * https://github.com/cvazac/eslint-plugin-react-perf/blob/HEAD/docs/rules/jsx-no-new-array-as-prop.md
31
- */
32
- "react-perf/jsx-no-new-array-as-prop": "off",
33
- /*
34
- * Prevent Functions that are local to the current method from being used as values of JSX props
35
- *
36
- * https://github.com/cvazac/eslint-plugin-react-perf/blob/HEAD/docs/rules/jsx-no-new-function-as-prop.md
37
- */
38
- "react-perf/jsx-no-new-function-as-prop": "warn",
39
- /*
40
- * Prevent Objects that are local to the current method from being used as values of JSX props
41
- *
42
- * This is really annoying in practice, we're turning it off
43
- *
44
- * https://github.com/cvazac/eslint-plugin-react-perf/blob/HEAD/docs/rules/jsx-no-new-object-as-prop.md
45
- */
46
- "react-perf/jsx-no-new-object-as-prop": "off",
47
- },
48
- },
49
- ];
@@ -1,3 +0,0 @@
1
- import type { Linter } from "eslint";
2
- export declare const reactRefreshPlugin: Linter.Config[];
3
- //# sourceMappingURL=react-refresh.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-refresh.d.ts","sourceRoot":"","sources":["../../src/plugins/react-refresh.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAgB7C,CAAC"}
@@ -1,21 +0,0 @@
1
- import reactRefresh from "eslint-plugin-react-refresh";
2
- /*
3
- * Validate that your components can safely be updated with fast refresh.
4
- *
5
- * https://github.com/ArnaudBarre/eslint-plugin-react-refresh
6
- */
7
- export const reactRefreshPlugin = [
8
- {
9
- plugins: {
10
- "react-refresh": reactRefresh,
11
- },
12
- rules: {
13
- /*
14
- * Validate that your components can safely be updated with fast refresh.
15
- *
16
- * https://github.com/ArnaudBarre/eslint-plugin-react-refresh#usage
17
- */
18
- "react-refresh/only-export-components": "warn",
19
- },
20
- },
21
- ];
@@ -1,3 +0,0 @@
1
- import type { Linter } from "eslint";
2
- export declare const reactPlugin: Linter.Config[];
3
- //# sourceMappingURL=react.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/plugins/react.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAi0BtC,CAAC"}