@baseplate-dev/tools 0.4.0 → 0.4.2
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-configs/typescript.js +11 -2
- package/package.json +2 -2
|
@@ -18,6 +18,9 @@ import noUnusedGeneratorDependencies from './rules/no-unused-generator-dependenc
|
|
|
18
18
|
* @property {string[]} [extraDefaultProjectFiles] - Additional default project files
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
const KEEP_UNUSED_IMPORTS =
|
|
22
|
+
process.env.BASEPLATE_KEEP_UNUSED_IMPORTS === 'true';
|
|
23
|
+
|
|
21
24
|
/**
|
|
22
25
|
* Generates a Typescript ESLint configuration
|
|
23
26
|
* @param {GenerateTypescriptEslintConfigOptions[]} [options=[]] - Configuration options
|
|
@@ -138,8 +141,14 @@ export function generateTypescriptEslintConfig(options = []) {
|
|
|
138
141
|
'unused-imports': unusedImports,
|
|
139
142
|
},
|
|
140
143
|
rules: {
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
// Prevent unused imports from being auto-removed if the environment variable is set to true
|
|
145
|
+
// This is useful when AI agents are editing code part by part
|
|
146
|
+
'@typescript-eslint/no-unused-vars': KEEP_UNUSED_IMPORTS
|
|
147
|
+
? 'error'
|
|
148
|
+
: 'off',
|
|
149
|
+
'unused-imports/no-unused-imports': KEEP_UNUSED_IMPORTS
|
|
150
|
+
? 'off'
|
|
151
|
+
: 'error',
|
|
143
152
|
'unused-imports/no-unused-vars': [
|
|
144
153
|
'error',
|
|
145
154
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseplate-dev/tools",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Shared dev configurations for linting, formatting, and testing Baseplate projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"development-tools",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"eslint-plugin-perfectionist": "4.15.0",
|
|
62
62
|
"eslint-plugin-react": "7.37.5",
|
|
63
63
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
64
|
-
"eslint-plugin-storybook": "
|
|
64
|
+
"eslint-plugin-storybook": "10.1.10",
|
|
65
65
|
"eslint-plugin-unicorn": "60.0.0",
|
|
66
66
|
"eslint-plugin-unused-imports": "4.1.4",
|
|
67
67
|
"globals": "16.4.0",
|