Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linter rules #35

Merged
merged 3 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 56 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@oclif/plugin-not-found": "^2.3.1",
"ajv": "^8.11.0",
"camelcase": "^5.2.0",
"chokidar": "^3.5.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this dependency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, I missed it. Going to need it in the next pull request

"decompress": "^4.2.1",
"filenamify": "^4",
"inquirer": "^8.2.4",
Expand Down Expand Up @@ -126,6 +127,13 @@
"error",
"never"
],
"curly": [
"error",
"all"
],
"no-unused-expressions": [
"error"
],
"dot-notation": [
"error",
{
Expand All @@ -142,6 +150,54 @@
"case": "camelCase"
}
],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "multiline-expression",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-expression"
},
{
"blankLine": "always",
"prev": "multiline-block-like",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-block-like"
},
{
"blankLine": "always",
"prev": "multiline-const",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-const"
},
{
"blankLine": "always",
"prev": "multiline-let",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-let"
},
{
"blankLine": "any",
"prev": "case",
"next": "case"
}
],
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
Expand Down Expand Up @@ -192,7 +248,6 @@
"./resources/license-header.js"
],
"brace-style": "off",
"padding-line-between-statements": "off",
"lines-between-class-members": "off",
"padded-blocks": "off",
"indent": "off",
Expand Down
8 changes: 8 additions & 0 deletions src/commands/dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const NAME = "NAME";
const RECOMMENDED = "recommended";
const VERSION_FLAG_NAME = "version";
const USE_FLAG_NAME = "use";

const RESET_ALL_MESSAGE = `If you omit ${color.yellow(
NAME
)} argument and include ${color.yellow(
Expand Down Expand Up @@ -97,15 +98,18 @@ export default class Dependency extends Command {
const dependencyConfig = await initDependencyConfig(this);
dependencyConfig.dependency = {};
await dependencyConfig.$commit();

for (const dependencyName of dependencyList) {
// eslint-disable-next-line no-await-in-loop
await ensureDependency(dependencyName, this);
}

this.log(
`Successfully reset all dependencies to ${color.yellow(
RECOMMENDED
)} versions`
);

return;
}

Expand Down Expand Up @@ -136,6 +140,7 @@ export default class Dependency extends Command {
}

const dependencyName = name;

const { recommendedVersion, packageName } = {
...npmDependencies,
...cargoDependencies,
Expand Down Expand Up @@ -244,8 +249,10 @@ const ensureDependency = async (
name: dependencyName,
commandObj,
});

break;
}

default: {
const _exhaustiveCheck: never = dependencyName;
return _exhaustiveCheck;
Expand All @@ -265,6 +272,7 @@ const handleUse = async ({
version,
}: HandleUseArg): Promise<void> => {
const dependencyConfig = await initDependencyConfig(commandObj);

const updatedDependencyVersionsConfig = {
...dependencyConfig.dependency,
[dependencyName]: version === RECOMMENDED ? undefined : version,
Expand Down
Loading