Skip to content

Commit 9dfbc52

Browse files
authoredApr 4, 2024··
feat(eslint-config): add ignores from gitignore by default (#376)
1 parent 7130879 commit 9dfbc52

File tree

4 files changed

+97
-1
lines changed

4 files changed

+97
-1
lines changed
 

Diff for: ‎packages/eslint-config/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@stylistic/eslint-plugin": "^1.7.0",
4444
"@typescript-eslint/eslint-plugin": "^7.5.0",
4545
"@typescript-eslint/parser": "^7.5.0",
46+
"eslint-config-flat-gitignore": "^0.1.5",
4647
"eslint-flat-config-utils": "^0.2.0",
4748
"eslint-plugin-vue": "^9.24.0",
4849
"globals": "^15.0.0",

Diff for: ‎packages/eslint-config/src/flat/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { FlatConfigItem, ResolvableFlatConfig } from 'eslint-flat-config-ut
1010
import type { FlatConfigComposer } from 'eslint-flat-config-utils'
1111
import { composer } from 'eslint-flat-config-utils'
1212
import { resolveOptions } from './utils'
13+
import gitignore from 'eslint-config-flat-gitignore'
1314

1415
export * from './types'
1516

@@ -41,6 +42,7 @@ export function createConfigForNuxt(options: NuxtESLintConfigOptions = {}): Flat
4142

4243
if (resolved.features.standalone !== false) {
4344
c.append(
45+
gitignore({ strict: false }),
4446
base(),
4547
javascript(),
4648
typescript(resolved),

Diff for: ‎packages/eslint-config/test/__snapshots__/flat-compose.test.ts.snap

+44
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
exports[`flat config composition > custom src dirs 1`] = `
44
[
5+
{
6+
"ignores": [
7+
"node_modules",
8+
"**/node_modules/**",
9+
"*.iml",
10+
"**/*.iml/**",
11+
".idea",
12+
"**/.idea/**",
13+
"*.log",
14+
"**/*.log/**",
15+
".nuxt",
16+
"**/.nuxt/**",
17+
".output",
18+
"**/.output/**",
19+
"**/.yarn/cache",
20+
"**/.yarn/*state*",
21+
"dist",
22+
"**/dist/**",
23+
".eslintcache",
24+
"**/.eslintcache/**",
25+
],
26+
},
527
{
628
"ignores": [
729
"**/dist",
@@ -79,6 +101,28 @@ exports[`flat config composition > custom src dirs 1`] = `
79101

80102
exports[`flat config composition > empty 1`] = `
81103
[
104+
{
105+
"ignores": [
106+
"node_modules",
107+
"**/node_modules/**",
108+
"*.iml",
109+
"**/*.iml/**",
110+
".idea",
111+
"**/.idea/**",
112+
"*.log",
113+
"**/*.log/**",
114+
".nuxt",
115+
"**/.nuxt/**",
116+
".output",
117+
"**/.output/**",
118+
"**/.yarn/cache",
119+
"**/.yarn/*state*",
120+
"dist",
121+
"**/dist/**",
122+
".eslintcache",
123+
"**/.eslintcache/**",
124+
],
125+
},
82126
{
83127
"ignores": [
84128
"**/dist",

Diff for: ‎pnpm-lock.yaml

+50-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.