Skip to content

Commit 12c11ae

Browse files
alexeyr-ci2alexeyr
andauthored
Don't lint any git-ignored files (#1718)
* Don't lint any git-ignored files * Improve ignores * Unify .gitignore files --------- Co-authored-by: Alexey Romanov <[email protected]>
1 parent 5621e31 commit 12c11ae

File tree

6 files changed

+40
-47
lines changed

6 files changed

+40
-47
lines changed

.gitignore

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/.bundle/
1+
.bundle/
22
/.yardoc
33
/_yardoc/
4-
/coverage/
4+
coverage/
55
/doc/
66
/pkg/
77
/spec/reports/
@@ -12,6 +12,8 @@
1212
/spec/examples.txt
1313
/spec/react_on_rails/dummy-for-generators/
1414

15+
tmp/
16+
1517
# RVM
1618
.ruby-version
1719
.ruby-gemset
@@ -23,6 +25,7 @@ node_modules
2325
yarn-debug.*
2426
yarn-error.*
2527
npm-debug.*
28+
.yarn-integrity
2629

2730
/gen-examples
2831

@@ -39,3 +42,21 @@ yalc.lock
3942

4043
# TypeScript
4144
*.tsbuildinfo
45+
46+
# Dummy app
47+
/spec/dummy/vendor/bundle
48+
/spec/dummy/db/*.sqlite3*
49+
/spec/dummy/log/**/*
50+
!/spec/dummy/log/.keep
51+
/spec/dummy/public/assets/
52+
/spec/dummy/public/webpack/
53+
/spec/dummy/spec/examples.txt
54+
55+
# ReScript build files
56+
/spec/dummy/.merlin
57+
/spec/dummy/lib/bs/
58+
/spec/dummy/.bsb.lock
59+
/spec/dummy/**/*.res.js
60+
61+
# Generated by ROR FS-based Registry
62+
generated

eslint.config.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import path from 'node:path';
12
import { globalIgnores } from 'eslint/config';
23
import prettierRecommended from 'eslint-plugin-prettier/recommended';
34
import globals from 'globals';
45
import tsEslint from 'typescript-eslint';
6+
import { includeIgnoreFile } from '@eslint/compat';
57
import js from '@eslint/js';
68
import { FlatCompat } from '@eslint/eslintrc';
79

@@ -12,6 +14,7 @@ const compat = new FlatCompat({
1214
});
1315

1416
const config = tsEslint.config([
17+
includeIgnoreFile(path.resolve(__dirname, '.gitignore')),
1518
globalIgnores([
1619
// compiled code
1720
'node_package/lib/',
@@ -26,16 +29,18 @@ const config = tsEslint.config([
2629
'spec/dummy/client/app/packs/server-bundle.js',
2730
'**/*.res.js',
2831
'**/coverage',
29-
'**/assets/webpack/**/*',
30-
'**/public/webpack/**/*',
31-
'**/generated/**/*',
32+
'**/assets/webpack/',
33+
'**/public/webpack/',
34+
'**/generated/',
3235
'**/app/assets/javascripts/application.js',
3336
'**/cable.js',
34-
'**/public/packs*/*',
37+
'**/public/packs*/',
3538
'**/gen-examples/',
3639
'**/bundle/',
3740
// dependencies
38-
'**/node_modules/**/*',
41+
'**/node_modules/',
42+
// fixtures
43+
'**/fixtures/',
3944
]),
4045
{
4146
files: ['**/*.[jt]s', '**/*.[jt]sx', '**/*.[cm][jt]s'],

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@babel/eslint-parser": "^7.26.10",
2424
"@babel/preset-env": "^7.20.2",
2525
"@babel/preset-react": "^7.26.3",
26+
"@eslint/compat": "^1.2.7",
2627
"@testing-library/dom": "^10.4.0",
2728
"@testing-library/jest-dom": "^6.6.3",
2829
"@testing-library/react": "^16.2.0",

script/convert

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ gsub_file_content("../package.json", /"globals": "[^"]*",/, "")
2121
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
2222
gsub_file_content("../package.json", /"typescript-eslint": "[^"]*",/, "")
2323
gsub_file_content("../package.json", %r{"@arethetypeswrong/cli": "[^"]*",}, "")
24+
gsub_file_content("../package.json", %r{"@eslint/compat": "[^"]*",}, "")
2425
gsub_file_content("../package.json", %r{"@testing-library/dom": "[^"]*",}, "")
2526
gsub_file_content("../package.json", %r{"@testing-library/react": "[^"]*",}, "")
2627
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")

spec/dummy/.gitignore

-40
This file was deleted.

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,11 @@
10731073
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0"
10741074
integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==
10751075

1076+
"@eslint/compat@^1.2.7":
1077+
version "1.2.7"
1078+
resolved "https://registry.yarnpkg.com/@eslint/compat/-/compat-1.2.7.tgz#f1a890281631ad27530479420b743dd92626e819"
1079+
integrity sha512-xvv7hJE32yhegJ8xNAnb62ggiAwTYHBpUCWhRxEj/ksvgDJuSXfoDkBcRYaYNFiJ+jH0IE3K16hd+xXzhBgNbg==
1080+
10761081
"@eslint/config-array@^0.19.2":
10771082
version "0.19.2"
10781083
resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.2.tgz#3060b809e111abfc97adb0bb1172778b90cb46aa"

0 commit comments

Comments
 (0)