Skip to content

Commit

Permalink
feat(eslint-config): add ignores from gitignore by default (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 4, 2024
1 parent 7130879 commit 9dfbc52
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@stylistic/eslint-plugin": "^1.7.0",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint-config-flat-gitignore": "^0.1.5",
"eslint-flat-config-utils": "^0.2.0",
"eslint-plugin-vue": "^9.24.0",
"globals": "^15.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-config/src/flat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { FlatConfigItem, ResolvableFlatConfig } from 'eslint-flat-config-ut
import type { FlatConfigComposer } from 'eslint-flat-config-utils'
import { composer } from 'eslint-flat-config-utils'
import { resolveOptions } from './utils'
import gitignore from 'eslint-config-flat-gitignore'

export * from './types'

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

if (resolved.features.standalone !== false) {
c.append(
gitignore({ strict: false }),
base(),
javascript(),
typescript(resolved),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

exports[`flat config composition > custom src dirs 1`] = `
[
{
"ignores": [
"node_modules",
"**/node_modules/**",
"*.iml",
"**/*.iml/**",
".idea",
"**/.idea/**",
"*.log",
"**/*.log/**",
".nuxt",
"**/.nuxt/**",
".output",
"**/.output/**",
"**/.yarn/cache",
"**/.yarn/*state*",
"dist",
"**/dist/**",
".eslintcache",
"**/.eslintcache/**",
],
},
{
"ignores": [
"**/dist",
Expand Down Expand Up @@ -79,6 +101,28 @@ exports[`flat config composition > custom src dirs 1`] = `

exports[`flat config composition > empty 1`] = `
[
{
"ignores": [
"node_modules",
"**/node_modules/**",
"*.iml",
"**/*.iml/**",
".idea",
"**/.idea/**",
"*.log",
"**/*.log/**",
".nuxt",
"**/.nuxt/**",
".output",
"**/.output/**",
"**/.yarn/cache",
"**/.yarn/*state*",
"dist",
"**/dist/**",
".eslintcache",
"**/.eslintcache/**",
],
},
{
"ignores": [
"**/dist",
Expand Down
51 changes: 50 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9dfbc52

Please sign in to comment.