@soujvnunes/eslint-config 0.1.0 → 0.2.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.
- package/dist/index.js +17 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -149,6 +149,22 @@ var restrictedSyntaxRule = {
|
|
|
149
149
|
{
|
|
150
150
|
selector: "TSEnumDeclaration",
|
|
151
151
|
message: "Avoid enums; use const assertions or union types instead."
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
selector: "ImportDeclaration[source.value='react'] > ImportDefaultSpecifier",
|
|
155
|
+
message: "Do not import the React default \u2014 use the ambient `React.*` namespace (the react-jsx runtime needs no React import)."
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
selector: "ImportDeclaration[source.value='react'] > ImportNamespaceSpecifier",
|
|
159
|
+
message: "Do not `import * as React` \u2014 use the ambient `React.*` namespace."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
selector: "ImportDeclaration[source.value='react'] > ImportSpecifier[importKind='type']",
|
|
163
|
+
message: "Reference React types via the ambient `React.*` namespace, not a named `{ type X }` import from react."
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
selector: "ImportDeclaration[importKind='type'][source.value='react']",
|
|
167
|
+
message: 'Reference React types via the ambient `React.*` namespace, not `import type \u2026 from "react"`.'
|
|
152
168
|
}
|
|
153
169
|
]
|
|
154
170
|
};
|
|
@@ -178,11 +194,7 @@ var nextRules = {
|
|
|
178
194
|
var importOrderRule = (groups) => ({
|
|
179
195
|
"import-helpers/order-imports": [
|
|
180
196
|
"warn",
|
|
181
|
-
{
|
|
182
|
-
newlinesBetween: "always",
|
|
183
|
-
groups,
|
|
184
|
-
alphabetize: { order: "asc", ignoreCase: true }
|
|
185
|
-
}
|
|
197
|
+
{ newlinesBetween: "always", groups, alphabetize: { order: "asc", ignoreCase: true } }
|
|
186
198
|
]
|
|
187
199
|
});
|
|
188
200
|
var buildConfig = ({
|