-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add eslint scripts and default configs
- Loading branch information
1 parent
6e0eeb6
commit b56849a
Showing
12 changed files
with
707 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env node | ||
// Copyright IBM Corp. 2017,2018. All Rights Reserved. | ||
// Node module: @loopback/build | ||
// This file is licensed under the MIT License. | ||
// License text available at https://opensource.org/licenses/MIT | ||
|
||
/* | ||
======== | ||
Usage: | ||
node ./bin/run-eslint | ||
======== | ||
*/ | ||
|
||
'use strict'; | ||
|
||
function run(argv, options) { | ||
const utils = require('./utils'); | ||
|
||
const eslintOpts = argv.slice(2); | ||
|
||
const isConfigSet = utils.isOptionSet(eslintOpts, '-c', '--config'); | ||
const isExtSet = utils.isOptionSet(eslintOpts, '--ext'); | ||
|
||
const eslintConfigFile = isConfigSet | ||
? null | ||
: utils.getConfigFile('.eslintrc.js', '.eslintrc.json'); | ||
|
||
const eslintIgnoreFile = utils.getConfigFile('.eslintignore'); | ||
|
||
const args = []; | ||
if (eslintConfigFile) { | ||
args.push('-c', eslintConfigFile); | ||
} | ||
if (eslintIgnoreFile) { | ||
args.push('--ignore-path', eslintIgnoreFile); | ||
} | ||
|
||
if (!isExtSet) { | ||
args.push('--ext', '.js,.ts'); | ||
} | ||
args.push(...eslintOpts); | ||
|
||
return utils.runCLI('eslint/bin/eslint', args, options); | ||
} | ||
|
||
module.exports = run; | ||
if (require.main === module) run(process.argv); |
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,4 @@ | ||
node_modules/ | ||
dist/ | ||
coverage/ | ||
api-docs/ |
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,3 @@ | ||
module.exports = { | ||
extends: '@loopback/eslint-config', | ||
}; |
Oops, something went wrong.