@yasainet/eslint 0.0.29 → 0.0.30
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/package.json +1 -1
- package/src/common/entry-points.mjs +20 -0
- package/src/deno/index.mjs +7 -0
- package/src/next/index.mjs +6 -0
- package/src/node/index.mjs +6 -0
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Ban `import * as` at entry points. */
|
|
2
|
+
export function createEntryPointConfigs(entryPointFiles, entryPointIgnores = []) {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
name: "entry-points/no-namespace-import",
|
|
6
|
+
files: entryPointFiles,
|
|
7
|
+
ignores: entryPointIgnores,
|
|
8
|
+
rules: {
|
|
9
|
+
"no-restricted-syntax": [
|
|
10
|
+
"error",
|
|
11
|
+
{
|
|
12
|
+
selector: "ImportDeclaration:has(ImportNamespaceSpecifier)",
|
|
13
|
+
message:
|
|
14
|
+
"Entry points must use named imports instead of `import * as`. This makes dependencies explicit.",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
package/src/deno/index.mjs
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { createEntryPointConfigs } from "../common/entry-points.mjs";
|
|
1
2
|
import { createCommonConfigs } from "../common/index.mjs";
|
|
2
3
|
import { denoImportsConfigs } from "./imports.mjs";
|
|
3
4
|
|
|
4
5
|
const FEATURE_ROOT = "supabase/functions/_features";
|
|
5
6
|
|
|
7
|
+
const denoEntryPointConfigs = createEntryPointConfigs(
|
|
8
|
+
["supabase/functions/**/*.ts"],
|
|
9
|
+
["supabase/functions/_*/**"],
|
|
10
|
+
);
|
|
11
|
+
|
|
6
12
|
/** Deno ESLint flat config entry point. */
|
|
7
13
|
export const eslintConfig = [
|
|
8
14
|
...createCommonConfigs(FEATURE_ROOT, { banAliasImports: true }),
|
|
9
15
|
...denoImportsConfigs,
|
|
16
|
+
...denoEntryPointConfigs,
|
|
10
17
|
];
|
package/src/next/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createEntryPointConfigs } from "../common/entry-points.mjs";
|
|
1
2
|
import { createCommonConfigs } from "../common/index.mjs";
|
|
2
3
|
import { libBoundaryConfigs } from "../common/imports.mjs";
|
|
3
4
|
|
|
@@ -5,6 +6,10 @@ import { directivesConfigs } from "./directives.mjs";
|
|
|
5
6
|
import { importPathStyleConfigs } from "./imports.mjs";
|
|
6
7
|
import { namingConfigs } from "./naming.mjs";
|
|
7
8
|
|
|
9
|
+
const nextEntryPointConfigs = createEntryPointConfigs(
|
|
10
|
+
["src/app/**/*.ts", "src/app/**/*.tsx"],
|
|
11
|
+
);
|
|
12
|
+
|
|
8
13
|
/** Next.js ESLint flat config entry point. */
|
|
9
14
|
export const eslintConfig = [
|
|
10
15
|
...createCommonConfigs("src/features"),
|
|
@@ -12,4 +17,5 @@ export const eslintConfig = [
|
|
|
12
17
|
...namingConfigs,
|
|
13
18
|
...directivesConfigs,
|
|
14
19
|
...importPathStyleConfigs,
|
|
20
|
+
...nextEntryPointConfigs,
|
|
15
21
|
];
|
package/src/node/index.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { createEntryPointConfigs } from "../common/entry-points.mjs";
|
|
1
2
|
import { createCommonConfigs } from "../common/index.mjs";
|
|
2
3
|
|
|
4
|
+
const nodeEntryPointConfigs = createEntryPointConfigs(
|
|
5
|
+
["scripts/commands/*.ts"],
|
|
6
|
+
);
|
|
7
|
+
|
|
3
8
|
/** Node.js ESLint flat config entry point. */
|
|
4
9
|
export const eslintConfig = [
|
|
5
10
|
...createCommonConfigs("scripts/features", { banAliasImports: true }),
|
|
11
|
+
...nodeEntryPointConfigs,
|
|
6
12
|
];
|