Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: lint all files in the repo at the same time (#11425)
Previously, `npm run lint` would invoke ESLint three separate times for different sets of files. There doesn't seem to have been a clear reason for this (it was added in 9b8c639 about 5 years ago), and some files in the repo were inadvertently being missed. This commit updates the lint task to simply invoke ESLint once on the entire repository. It also fixes some linting errors in files that were previously being skipped.
- Loading branch information
1 parent
8f3d717
commit f6ba633
Showing
5 changed files
with
44 additions
and
77 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 |
---|---|---|
@@ -1,35 +1,9 @@ | ||
/** | ||
* @fileoverview Converts YAML file into JSON. | ||
* @author Nicholas C. Zakas | ||
* @fileoverview Index file to allow YAML file to be loaded | ||
* @author Teddy Katz | ||
*/ | ||
"use strict"; | ||
|
||
//------------------------------------------------------------------------------ | ||
// Requirements | ||
//------------------------------------------------------------------------------ | ||
|
||
var fs = require("fs"), | ||
path = require("path"), | ||
yaml = require("js-yaml"); | ||
|
||
//------------------------------------------------------------------------------ | ||
// Bootstrapping | ||
//------------------------------------------------------------------------------ | ||
|
||
var filePath = path.resolve(__dirname, "./default.yml"), | ||
config; | ||
|
||
try { | ||
config = yaml.safeLoad(fs.readFileSync(filePath, "utf8")) || {}; | ||
} catch (e) { | ||
console.error(`Error reading YAML file: ${filePath}`); | ||
e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; | ||
throw e; | ||
} | ||
|
||
|
||
//------------------------------------------------------------------------------ | ||
// Public Interface | ||
//------------------------------------------------------------------------------ | ||
|
||
module.exports = config; | ||
module.exports = { | ||
extends: ["./default.yml"] | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
mode: "none", | ||
entry: ["@babel/polyfill", "./lib/linter.js"], | ||
|