-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Bradshaw
committed
Jun 12, 2020
1 parent
6fa4275
commit 089e7f4
Showing
6 changed files
with
34 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const { cosmiconfigSync } = require('cosmiconfig') | ||
|
||
const { hasAnyDep } = require('./lib/utils') | ||
|
||
const explorerSync = cosmiconfigSync('eslint') | ||
const eslintrc = explorerSync.search() | ||
const { env } = eslintrc.config | ||
|
||
const hasBabel = hasAnyDep('babel') || hasAnyDep('@babel/core') | ||
|
||
const plugins = [] | ||
|
||
if (hasBabel) plugins.push('babel') | ||
if (env.node) plugins.push('node') | ||
|
||
if (env.browser && !hasBabel && !hasAnyDep('typescript')) plugins.push('compat') | ||
|
||
module.exports = plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// eslint-disable-next-line no-console | ||
console.log(' eslint-plugin-compat') | ||
|
||
module.exports = { | ||
extends: ['plugin:compat/recommended'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// eslint-disable-next-line no-console | ||
console.log(' eslint-plugin-node') | ||
|
||
module.exports = { | ||
extends: ['plugin:node/recommended'], | ||
} |