File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ import { includeIgnoreFile } from '@eslint/compat'
2+ import childProcess from 'node:child_process'
13import fs from 'node:fs'
4+ import path from 'node:path'
25
36import { htmlConfig } from './src/html.mjs'
47import { javascriptConfig } from './src/javascript.mjs'
@@ -8,6 +11,12 @@ import { reactConfig } from './src/react.mjs'
811import { typescriptConfig } from './src/typescript.mjs'
912import { ymlConfig } from './src/yml.mjs'
1013
14+ const processPath = childProcess
15+ . execSync ( 'git rev-parse --show-toplevel' )
16+ . toString ( )
17+ . trim ( )
18+
19+ const gitignorePath = path . resolve ( processPath , '.gitignore' )
1120const jsonData = fs . readFileSync ( './package.json' , 'utf8' )
1221const { name, version } = JSON . parse ( jsonData )
1322
@@ -18,6 +27,7 @@ export default {
1827 } ,
1928 configs : {
2029 base : [
30+ includeIgnoreFile ( gitignorePath ) ,
2131 ...htmlConfig ,
2232 ...javascriptConfig ,
2333 ...jsonConfig ,
@@ -26,6 +36,7 @@ export default {
2636 ...ymlConfig ,
2737 ] ,
2838 react : [
39+ includeIgnoreFile ( gitignorePath ) ,
2940 ...htmlConfig ,
3041 ...javascriptConfig ,
3142 ...jsonConfig ,
Original file line number Diff line number Diff line change 3131 },
3232 "dependencies" : {
3333 "@eslint-community/eslint-plugin-eslint-comments" : " ^4.5.0" ,
34+ "@eslint/compat" : " ^1.4.0" ,
3435 "@eslint/js" : " ^9.35.0" ,
3536 "@eslint/json" : " ^0.13.2" ,
3637 "@html-eslint/eslint-plugin" : " ^0.46.2" ,
You can’t perform that action at this time.
0 commit comments