@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
@@ -1,4 +1,3 @@
1
1
  import openTuroTypescriptConfig from "./index.mjs";
2
2
 
3
- // eslint-disable-next-line import/no-default-export
4
3
  export default openTuroTypescriptConfig({ typescript: true });
package/index.js CHANGED
@@ -80,38 +80,51 @@ const getImportPluginFlatConfigs = () => {
80
80
  };
81
81
 
82
82
  const importConfig = () =>
83
- eslintConfig.defineConfig({
84
- extends: [getImportPluginFlatConfigs().recommended],
85
- rules: {
86
- "import/default": "off",
87
- "import/named": "off",
88
- "import/namespace": "off",
89
- "import/no-default-export": "error",
90
- "import/no-extraneous-dependencies": [
91
- "error",
92
- { devDependencies: [`eslint.config.${FILES_SRC_EXTENSION}`] },
93
- ],
94
- "import/prefer-default-export": "off",
95
- },
96
- settings: {
97
- "import/resolver": {
98
- typescript: {
99
- alwaysTryTypes: true,
100
- /**
101
- * Without an explicit `project`, the resolver caches a single tsconfig for the
102
- * entire process (keyed by whatever the CWD was on first resolution). In a
103
- * monorepo, running lint from the repo root (e.g. via pre-commit across
104
- * packages) causes every file to resolve imports/aliases against just one
105
- * package's tsconfig. Globbing for all tsconfigs makes the resolver pick the
106
- * nearest one per file instead.
107
- * @see https://github.com/import-js/eslint-import-resolver-typescript#project
108
- */
109
- noWarnOnMultipleProjects: true,
110
- project: ["**/tsconfig.json"],
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({
package/package.json CHANGED
@@ -57,6 +57,6 @@
57
57
  "access": "public"
58
58
  },
59
59
  "repository": "https://github.com/open-turo/eslint-config-typescript",
60
- "version": "23.1.18",
60
+ "version": "23.2.0",
61
61
  "packageManager": "npm@11.19.0"
62
62
  }