-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: eslint configs is changed. We made it full configurable of ESLint and remove all the hard coding config properties in 0.3.x. Now, you are allowed to write lint command which you're more familar with rather than JS config.
- Loading branch information
Showing
7 changed files
with
149 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* eslint-disable */ | ||
|
||
// Copied from /eslint@7.28.0/node_modules/eslint/lib/cli.js | ||
|
||
function quietFixPredicate(message) { | ||
return message.severity === 2 | ||
} | ||
|
||
export function translateOptions({ | ||
cache, | ||
cacheFile, | ||
cacheLocation, | ||
cacheStrategy, | ||
config, | ||
env, | ||
errorOnUnmatchedPattern, | ||
eslintrc, | ||
ext, | ||
fix, | ||
fixDryRun, | ||
fixType, | ||
global, | ||
ignore, | ||
ignorePath, | ||
ignorePattern, | ||
inlineConfig, | ||
parser, | ||
parserOptions, | ||
plugin, | ||
quiet, | ||
reportUnusedDisableDirectives, | ||
resolvePluginsRelativeTo, | ||
rule, | ||
rulesdir, | ||
}) { | ||
return { | ||
allowInlineConfig: inlineConfig, | ||
cache, | ||
cacheLocation: cacheLocation || cacheFile, | ||
cacheStrategy, | ||
errorOnUnmatchedPattern, | ||
extensions: ext, | ||
fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true), | ||
fixTypes: fixType, | ||
ignore, | ||
ignorePath, | ||
overrideConfig: { | ||
env: | ||
env && | ||
env.reduce((obj, name) => { | ||
obj[name] = true | ||
return obj | ||
}, {}), | ||
globals: | ||
global && | ||
global.reduce((obj, name) => { | ||
if (name.endsWith(':true')) { | ||
obj[name.slice(0, -5)] = 'writable' | ||
} else { | ||
obj[name] = 'readonly' | ||
} | ||
return obj | ||
}, {}), | ||
ignorePatterns: ignorePattern, | ||
parser, | ||
parserOptions, | ||
plugins: plugin, | ||
rules: rule, | ||
}, | ||
overrideConfigFile: config, | ||
reportUnusedDisableDirectives: reportUnusedDisableDirectives ? 'error' : void 0, | ||
resolvePluginsRelativeTo, | ||
rulePaths: rulesdir, | ||
useEslintrc: eslintrc, | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"target": "ES2015", | ||
"lib": ["ESNext"], | ||
"module": "CommonJS", | ||
|