-
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
c949e85
commit a6abe86
Showing
13 changed files
with
437 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,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', | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.