-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfix-eslint.js
More file actions
33 lines (31 loc) · 818 Bytes
/
fix-eslint.js
File metadata and controls
33 lines (31 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const fs = require('fs')
module.exports.removeTsConfig = () => {
fs.readFile('./.eslintrc', 'utf8', (err, data) => {
if (err) {
console.log(err)
return
}
const result = data.toString().replace('"tsconfigRootDir": "./design-system"', '"tsconfigRootDir": ""')
fs.writeFile('./.eslintrc', result, 'utf8', (err) => {
if (err) {
console.log(err)
return
}
})
})
}
module.exports.addTsConfig = () => {
fs.readFile('./.eslintrc', 'utf8', (err, data) => {
if (err) {
console.log(err)
return
}
const result = data.toString().replace('"tsconfigRootDir": ""', '"tsconfigRootDir": "./design-system"')
fs.writeFile('./.eslintrc', result, 'utf8', (err) => {
if (err) {
console.log(err)
return
}
})
})
}