-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scripts): use esprint to eslint --fix clients source code (#2846)
- Loading branch information
Showing
5 changed files
with
167 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"paths": [ | ||
"codegen/sdk-codegen/build/smithyprojections/sdk-codegen/*/typescript-codegen/**/*.ts", | ||
"codegen/protocol-test-codegen/build/smithyprojections/protocol-test-codegen/*/typescript-codegen/**/*.ts" | ||
], | ||
"ignored": [] | ||
} |
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,21 @@ | ||
// @ts-check | ||
const { spawnProcess } = require("../utils/spawn-process"); | ||
const path = require("path"); | ||
|
||
const eslintFixCode = async () => { | ||
try { | ||
await spawnProcess(path.join(__dirname, "..", "..", "node_modules", ".bin", "esprint"), [ | ||
"check", | ||
"--fix", | ||
"--quiet", | ||
]); | ||
} catch (error) { | ||
// esprint throws error as the clients source code does not follow 'prefer-const' rule. | ||
// And esprint does not have a way to override rules written in .eslintrc | ||
// We will still get linted code though. | ||
} | ||
}; | ||
|
||
module.exports = { | ||
eslintFixCode, | ||
}; |
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