Skip to content

Commit

Permalink
fix: potentially fix vue and react bug
Browse files Browse the repository at this point in the history
  • Loading branch information
OrbisK committed Jan 3, 2023
1 parent 6383011 commit 1b22de4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
8 changes: 6 additions & 2 deletions configs/react/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
const { isPackageExists } = require('local-pkg')

const react = isPackageExists('react')

module.exports = react ? {
plugins: [
'react',
'react-hooks',
Expand Down Expand Up @@ -115,5 +119,5 @@ module.exports = {
},
],
},
}
} : {}

7 changes: 5 additions & 2 deletions configs/vue/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
const {isPackageExists} = require("local-pkg");
const vue = isPackageExists('vue')

module.exports = vue ? {
overrides: [
{
files: ['*.vue'],
Expand All @@ -13,4 +16,4 @@ module.exports = {
'@singularit/eslint-config-typescript',
],
rules: {},
}
} : {}
23 changes: 21 additions & 2 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"local-pkg": "^0.4.2"
}
}

0 comments on commit 1b22de4

Please sign in to comment.