@diplodoc/lint 1.9.1 → 1.9.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/.lintstagedrc.js
CHANGED
|
@@ -8,16 +8,14 @@ const {readFileSync} = require('node:fs');
|
|
|
8
8
|
const {join} = require('node:path');
|
|
9
9
|
|
|
10
10
|
// Check if this is the @diplodoc/lint package itself
|
|
11
|
-
|
|
11
|
+
const isLintPkg = (() => {
|
|
12
12
|
try {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const pkg = JSON.parse(readFileSync(join(process.cwd(), 'package.json'), 'utf8'));
|
|
14
|
+
return pkg.name === '@diplodoc/lint';
|
|
15
15
|
} catch {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const isLintPkg = isLintPackage();
|
|
18
|
+
})();
|
|
21
19
|
|
|
22
20
|
module.exports = {
|
|
23
21
|
// Exclude config files from linting (they use CommonJS)
|
|
@@ -33,15 +31,17 @@ module.exports = {
|
|
|
33
31
|
const filtered = filenames.filter(
|
|
34
32
|
(f) =>
|
|
35
33
|
!configFiles.some((config) => f.includes(config)) &&
|
|
36
|
-
// For @diplodoc/lint package itself: exclude bin/ (
|
|
37
|
-
!(isLintPkg && f.includes('bin/')),
|
|
34
|
+
// For @diplodoc/lint package itself: exclude bin/ and scripts/ (in .eslintignore)
|
|
35
|
+
!(isLintPkg && (f.includes('bin/') || f.includes('scripts/'))),
|
|
38
36
|
);
|
|
39
37
|
if (filtered.length === 0) {
|
|
40
38
|
return [];
|
|
41
39
|
}
|
|
42
40
|
return [
|
|
43
41
|
...filtered.map((f) => `prettier --write ${f}`),
|
|
44
|
-
...filtered.map(
|
|
42
|
+
...filtered.map(
|
|
43
|
+
(f) => `env ESLINT_USE_FLAT_CONFIG=false npx eslint --max-warnings=0 --fix ${f}`,
|
|
44
|
+
),
|
|
45
45
|
];
|
|
46
46
|
},
|
|
47
47
|
// Handle .lintstagedrc.js separately (only prettier, no eslint)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.9.2](https://github.com/diplodoc-platform/lint/compare/v1.9.1...v1.9.2) (2025-12-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* use ESLINT_USE_FLAT_CONFIG=false in lint-staged ([88a17b6](https://github.com/diplodoc-platform/lint/commit/88a17b62a791cc491f195ed66b69f63964f89f9b))
|
|
9
|
+
|
|
3
10
|
## [1.9.1](https://github.com/diplodoc-platform/lint/compare/v1.9.0...v1.9.1) (2025-12-29)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -8,16 +8,14 @@ const {readFileSync} = require('node:fs');
|
|
|
8
8
|
const {join} = require('node:path');
|
|
9
9
|
|
|
10
10
|
// Check if this is the @diplodoc/lint package itself
|
|
11
|
-
|
|
11
|
+
const isLintPkg = (() => {
|
|
12
12
|
try {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const pkg = JSON.parse(readFileSync(join(process.cwd(), 'package.json'), 'utf8'));
|
|
14
|
+
return pkg.name === '@diplodoc/lint';
|
|
15
15
|
} catch {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const isLintPkg = isLintPackage();
|
|
18
|
+
})();
|
|
21
19
|
|
|
22
20
|
module.exports = {
|
|
23
21
|
// Exclude config files from linting (they use CommonJS)
|
|
@@ -33,15 +31,17 @@ module.exports = {
|
|
|
33
31
|
const filtered = filenames.filter(
|
|
34
32
|
(f) =>
|
|
35
33
|
!configFiles.some((config) => f.includes(config)) &&
|
|
36
|
-
// For @diplodoc/lint package itself: exclude bin/ (
|
|
37
|
-
!(isLintPkg && f.includes('bin/')),
|
|
34
|
+
// For @diplodoc/lint package itself: exclude bin/ and scripts/ (in .eslintignore)
|
|
35
|
+
!(isLintPkg && (f.includes('bin/') || f.includes('scripts/'))),
|
|
38
36
|
);
|
|
39
37
|
if (filtered.length === 0) {
|
|
40
38
|
return [];
|
|
41
39
|
}
|
|
42
40
|
return [
|
|
43
41
|
...filtered.map((f) => `prettier --write ${f}`),
|
|
44
|
-
...filtered.map(
|
|
42
|
+
...filtered.map(
|
|
43
|
+
(f) => `env ESLINT_USE_FLAT_CONFIG=false npx eslint --max-warnings=0 --fix ${f}`,
|
|
44
|
+
),
|
|
45
45
|
];
|
|
46
46
|
},
|
|
47
47
|
// Handle .lintstagedrc.js separately (only prettier, no eslint)
|
package/scripts/modify-ignore.js
CHANGED
|
@@ -20,22 +20,6 @@ const INSTALL = [
|
|
|
20
20
|
'node_modules',
|
|
21
21
|
];
|
|
22
22
|
|
|
23
|
-
// Check if this is the @diplodoc/lint package itself
|
|
24
|
-
function isLintPackage() {
|
|
25
|
-
try {
|
|
26
|
-
const packageJsonPath = join(process.cwd(), 'package.json');
|
|
27
|
-
if (!existsSync(packageJsonPath)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
31
|
-
return packageJson.name === '@diplodoc/lint';
|
|
32
|
-
} catch {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const isLintPkg = isLintPackage();
|
|
38
|
-
|
|
39
23
|
const ignores = {
|
|
40
24
|
'.gitignore': [
|
|
41
25
|
...SYSTEM,
|
|
@@ -53,8 +37,6 @@ const ignores = {
|
|
|
53
37
|
'.stylelintrc.js',
|
|
54
38
|
// Build scripts that use newer syntax not yet supported by ESLint parser
|
|
55
39
|
'esbuild/**/*.mjs',
|
|
56
|
-
// For @diplodoc/lint package itself: bin/ contains internal scripts
|
|
57
|
-
...(isLintPkg ? ['bin/'] : []),
|
|
58
40
|
],
|
|
59
41
|
'.prettierignore': [
|
|
60
42
|
...SYSTEM,
|
|
@@ -32,27 +32,18 @@ const configContent = configTemplate
|
|
|
32
32
|
|
|
33
33
|
const manifestContent = manifestTemplate
|
|
34
34
|
.replace(/\{\{PACKAGE_VERSION\}\}/g, packageVersion)
|
|
35
|
-
.trimEnd(); // Remove trailing whitespace/newlines
|
|
35
|
+
.trimEnd() + '\n'; // Remove trailing whitespace/newlines
|
|
36
36
|
|
|
37
37
|
// Write files
|
|
38
38
|
const configOutputPath = join(process.cwd(), '.release-please-config.json');
|
|
39
39
|
const manifestOutputPath = join(process.cwd(), '.release-please-manifest.json');
|
|
40
40
|
|
|
41
|
-
// Only create if they don't exist (preserve existing configs)
|
|
42
41
|
if (!existsSync(configOutputPath)) {
|
|
43
|
-
writeFileSync(configOutputPath, configContent, 'utf8');
|
|
44
42
|
console.log('[@diplodoc/lint]', '=> Create .release-please-config.json');
|
|
45
|
-
|
|
46
|
-
console.log('[@diplodoc/lint]', '=> .release-please-config.json already exists, skipping');
|
|
43
|
+
writeFileSync(configOutputPath, configContent, 'utf8');
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
console.log('[@diplodoc/lint]', '=> Create .release-please-manifest.json');
|
|
52
|
-
} else {
|
|
53
|
-
// Always update manifest with current version
|
|
54
|
-
writeFileSync(manifestOutputPath, manifestContent, 'utf8');
|
|
55
|
-
console.log('[@diplodoc/lint]', '=> Update .release-please-manifest.json');
|
|
56
|
-
}
|
|
46
|
+
console.log('[@diplodoc/lint]', '=> Update .release-please-manifest.json');
|
|
47
|
+
writeFileSync(manifestOutputPath, manifestContent, 'utf8');
|
|
57
48
|
|
|
58
49
|
|