@open-turo/eslint-config-typescript 23.1.18 → 23.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/eslint.config.mjs
CHANGED
package/index.js
CHANGED
|
@@ -80,38 +80,51 @@ const getImportPluginFlatConfigs = () => {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const importConfig = () =>
|
|
83
|
-
eslintConfig.defineConfig(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
83
|
+
eslintConfig.defineConfig(
|
|
84
|
+
{
|
|
85
|
+
extends: [getImportPluginFlatConfigs().recommended],
|
|
86
|
+
rules: {
|
|
87
|
+
"import/default": "off",
|
|
88
|
+
"import/named": "off",
|
|
89
|
+
"import/namespace": "off",
|
|
90
|
+
"import/no-default-export": "error",
|
|
91
|
+
"import/no-extraneous-dependencies": [
|
|
92
|
+
"error",
|
|
93
|
+
{ devDependencies: [`eslint.config.${FILES_SRC_EXTENSION}`] },
|
|
94
|
+
],
|
|
95
|
+
"import/prefer-default-export": "off",
|
|
96
|
+
},
|
|
97
|
+
settings: {
|
|
98
|
+
"import/resolver": {
|
|
99
|
+
typescript: {
|
|
100
|
+
alwaysTryTypes: true,
|
|
101
|
+
/**
|
|
102
|
+
* Without an explicit `project`, the resolver caches a single tsconfig for the
|
|
103
|
+
* entire process (keyed by whatever the CWD was on first resolution). In a
|
|
104
|
+
* monorepo, running lint from the repo root (e.g. via pre-commit across
|
|
105
|
+
* packages) causes every file to resolve imports/aliases against just one
|
|
106
|
+
* package's tsconfig. Globbing for all tsconfigs makes the resolver pick the
|
|
107
|
+
* nearest one per file instead.
|
|
108
|
+
* @see https://github.com/import-js/eslint-import-resolver-typescript#project
|
|
109
|
+
*/
|
|
110
|
+
noWarnOnMultipleProjects: true,
|
|
111
|
+
project: ["**/tsconfig.json"],
|
|
112
|
+
},
|
|
111
113
|
},
|
|
112
114
|
},
|
|
113
115
|
},
|
|
114
|
-
|
|
116
|
+
// Tools like ESLint and Vitest require default exports in their config files
|
|
117
|
+
{
|
|
118
|
+
files: [
|
|
119
|
+
`*.config.${FILES_SRC_EXTENSION}`,
|
|
120
|
+
`*.config.mjs`,
|
|
121
|
+
`*.config.cjs`,
|
|
122
|
+
],
|
|
123
|
+
rules: {
|
|
124
|
+
"import/no-default-export": "off",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
);
|
|
115
128
|
|
|
116
129
|
const nPluginConfig = (allowModules = ["@jest/globals", "nock"]) =>
|
|
117
130
|
eslintConfig.defineConfig({
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|