@diplodoc/lint 1.10.2 → 1.10.3

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/.husky/commit-msg CHANGED
@@ -3,7 +3,7 @@ COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
3
3
 
4
4
  # Check if commit message contains Cyrillic characters
5
5
  # All commit messages must be in English per .agents/style-and-testing.md
6
- if echo "$COMMIT_MSG" | grep -q '[А-Яа-яЁё]'; then
6
+ if echo "$COMMIT_MSG" | LC_ALL=C grep -q '[А-Яа-яЁё]'; then
7
7
  echo "❌ Error: Commit message contains Cyrillic characters."
8
8
  echo ""
9
9
  echo "All commit messages must be in English per .agents/style-and-testing.md"
@@ -18,23 +18,23 @@ fi
18
18
  SUBJECT=$(echo "$COMMIT_MSG" | head -n1)
19
19
 
20
20
  # Allow fixup! and squash! prefixes (for git commit --fixup and --squash)
21
- if echo "$SUBJECT" | grep -qE '^(fixup!|squash!)'; then
21
+ if echo "$SUBJECT" | LC_ALL=C grep -qE '^(fixup!|squash!)'; then
22
22
  exit 0
23
23
  fi
24
24
 
25
25
  # Check Conventional Commits format: <type>(<scope>): <subject>
26
- # Types: feat, fix, perf, refactor, docs, chore, revert
26
+ # Types: feat, fix, perf, refactor, docs, chore, revert, deps
27
27
  # Scope is optional
28
- if ! echo "$SUBJECT" | grep -qE '^(feat|fix|perf|refactor|docs|chore|revert)(\([^)]+\))?: .+'; then
28
+ if ! echo "$SUBJECT" | LC_ALL=C grep -qE '^(feat|fix|perf|refactor|docs|chore|revert|deps)(\([^)]+\))?: .+'; then
29
29
  echo "❌ Error: Commit message does not follow Conventional Commits format."
30
30
  echo ""
31
31
  echo "Expected format: <type>(<scope>): <subject>"
32
32
  echo ""
33
- echo "Types: feat, fix, perf, refactor, docs, chore, revert"
33
+ echo "Types: feat, fix, perf, refactor, docs, chore, revert, deps"
34
34
  echo "Scope is optional"
35
35
  echo ""
36
36
  echo "Examples:"
37
- echo " feat(cli): add new command"
37
+ echo " feat(lint): add new command"
38
38
  echo " fix(transform): handle edge case"
39
39
  echo " docs(readme): update installation"
40
40
  echo ""
package/.lintstagedrc.js CHANGED
@@ -37,20 +37,19 @@ module.exports = {
37
37
  if (filtered.length === 0) {
38
38
  return [];
39
39
  }
40
+
40
41
  return [
41
- ...filtered.map((f) => `prettier --write ${f}`),
42
- ...filtered.map(
43
- (f) => `env ESLINT_USE_FLAT_CONFIG=false npx eslint --max-warnings=0 --fix ${f}`,
44
- ),
42
+ `prettier --write ${filtered.join(' ')}`,
43
+ `env ESLINT_USE_FLAT_CONFIG=false npx eslint --max-warnings=0 --fix`,
45
44
  ];
46
45
  },
47
46
  // Handle .lintstagedrc.js separately (only prettier, no eslint)
48
47
  '.lintstagedrc.js': (filenames) => filenames.map((f) => `prettier --write ${f}`),
49
48
  '**/*.{css,scss}': (filenames) => [
50
- ...filenames.map((f) => `prettier --write ${f}`),
51
- ...filenames.map((f) => `stylelint --fix ${f}`),
49
+ `prettier --write ${filenames.join(' ')}`,
50
+ `stylelint --fix ${filenames.join(' ')}`,
52
51
  ],
53
- '**/*.{json,yaml,yml,md}': (filenames) => filenames.map((f) => `prettier --write ${f}`),
52
+ '**/*.{json,yaml,yml,md}': (filenames) => `prettier --write ${filenames.join(' ')}`,
54
53
  '**/*.{svg,svgx}': ['svgo'],
55
54
  // Run unit tests when test files or source files change
56
55
  '**/*.{ts,tsx}': (filenames) => {
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.10.2"
2
+ ".": "1.10.3"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.10.3](https://github.com/diplodoc-platform/lint/compare/v1.10.2...v1.10.3) (2026-01-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Add warning to autogenerated files ([3f394fa](https://github.com/diplodoc-platform/lint/commit/3f394fa9800fc622d006d12257819f7bf1a562ba))
9
+ * Fix linstaged filters ([16d2b12](https://github.com/diplodoc-platform/lint/commit/16d2b12446c059db3040a7fd3f566da39d8dbbdb))
10
+ * **lint:** simplify stylelint execution and improve hasStyleFiles ([7e37390](https://github.com/diplodoc-platform/lint/commit/7e373900d764e58abe543bd6c837e94c073eb56e))
11
+
3
12
  ## [1.10.2](https://github.com/diplodoc-platform/lint/compare/v1.10.1...v1.10.2) (2026-01-22)
4
13
 
5
14
 
package/bin/lint.js CHANGED
@@ -48,7 +48,8 @@ function execCommand(cmd, options = {}) {
48
48
 
49
49
  function hasStyleFiles() {
50
50
  try {
51
- // Exclude common directories that should be ignored
51
+ // Quick check if there are any style files (excluding common ignored directories)
52
+ // This prevents hanging when scanning large projects
52
53
  const result = execSync(
53
54
  `find . -type f \\( -name '*.css' -o -name '*.scss' \\) ! -path '*/node_modules/*' ! -path '*/build/*' ! -path '*/lib/*' ! -path '*/dist/*' ! -path '*/cache/*' ! -path '*/coverage/*' ! -path '*/.git/*' 2>/dev/null | head -1`,
54
55
  {shell: shell, cwd: process.cwd(), encoding: 'utf8', stdio: 'pipe', timeout: 5000},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/lint",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
4
4
  "description": "Diplodoc platform internal utility set for linting",
5
5
  "bin": {
6
6
  "lint": "./bin/lint.js",
@@ -23,14 +23,14 @@ if echo "$SUBJECT" | grep -qE '^(fixup!|squash!)'; then
23
23
  fi
24
24
 
25
25
  # Check Conventional Commits format: <type>(<scope>): <subject>
26
- # Types: feat, fix, perf, refactor, docs, chore, revert
26
+ # Types: feat, fix, perf, refactor, docs, chore, revert, deps
27
27
  # Scope is optional
28
- if ! echo "$SUBJECT" | grep -qE '^(feat|fix|perf|refactor|docs|chore|revert)(\([^)]+\))?: .+'; then
28
+ if ! echo "$SUBJECT" | grep -qE '^(feat|fix|perf|refactor|docs|chore|revert|deps)(\([^)]+\))?: .+'; then
29
29
  echo "❌ Error: Commit message does not follow Conventional Commits format."
30
30
  echo ""
31
31
  echo "Expected format: <type>(<scope>): <subject>"
32
32
  echo ""
33
- echo "Types: feat, fix, perf, refactor, docs, chore, revert"
33
+ echo "Types: feat, fix, perf, refactor, docs, chore, revert, deps"
34
34
  echo "Scope is optional"
35
35
  echo ""
36
36
  echo "Examples:"
@@ -37,20 +37,19 @@ module.exports = {
37
37
  if (filtered.length === 0) {
38
38
  return [];
39
39
  }
40
+
40
41
  return [
41
- ...filtered.map((f) => `prettier --write ${f}`),
42
- ...filtered.map(
43
- (f) => `env ESLINT_USE_FLAT_CONFIG=false npx eslint --max-warnings=0 --fix ${f}`,
44
- ),
42
+ `prettier --write ${filtered.join(' ')}`,
43
+ `env ESLINT_USE_FLAT_CONFIG=false npx eslint --max-warnings=0 --fix`,
45
44
  ];
46
45
  },
47
46
  // Handle .lintstagedrc.js separately (only prettier, no eslint)
48
47
  '.lintstagedrc.js': (filenames) => filenames.map((f) => `prettier --write ${f}`),
49
48
  '**/*.{css,scss}': (filenames) => [
50
- ...filenames.map((f) => `prettier --write ${f}`),
51
- ...filenames.map((f) => `stylelint --fix ${f}`),
49
+ `prettier --write ${filenames.join(' ')}`,
50
+ `stylelint --fix ${filenames.join(' ')}`,
52
51
  ],
53
- '**/*.{json,yaml,yml,md}': (filenames) => filenames.map((f) => `prettier --write ${f}`),
52
+ '**/*.{json,yaml,yml,md}': (filenames) => `prettier --write ${filenames.join(' ')}`,
54
53
  '**/*.{svg,svgx}': ['svgo'],
55
54
  // Run unit tests when test files or source files change
56
55
  '**/*.{ts,tsx}': (filenames) => {