Skip to content

Commit

Permalink
Reconfigure standard and eslint (#1668)
Browse files Browse the repository at this point in the history
* Add eslint-config-standard peer dependencies explicitly

* Remove unused eslint customisation, closer to standard

* Configure eslint with no-extra-semi, as per semistandard

* Use standard-with-typescript again now installing dependencies

* Fix linting for undefined property

* Run js and rs lint by default for `npm run lint`
  • Loading branch information
shadowspawn committed Jan 4, 2022
1 parent f17ecbd commit 10b673f
Show file tree
Hide file tree
Showing 19 changed files with 487 additions and 1,727 deletions.
25 changes: 11 additions & 14 deletions .eslintrc.js
Expand Up @@ -6,10 +6,10 @@ const javascriptSettings = {
],
rules: {
'no-else-return': ['error', { allowElseIf: false }],
'no-var': 'warn',
'one-var': 'off',
'space-before-function-paren': ['error', 'never'],
semi: ['error', 'always']
// manual "semistandard" settings
semi: ['error', 'always'],
'no-extra-semi': 'error'
}
};

Expand All @@ -22,17 +22,12 @@ const typescriptSettings = {
'@typescript-eslint'
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
'standard-with-typescript'
],
rules: {
'no-else-return': ['error', { allowElseIf: false }],
'no-var': 'warn',
'one-var': 'off',
'space-before-function-paren': ['error', 'never'],
semi: 'off',
'@typescript-eslint/semi': ['error', 'always'],
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': ['error', 'never'],
'@typescript-eslint/member-delimiter-style': [
'error',
{
Expand All @@ -46,9 +41,11 @@ const typescriptSettings = {
}
}
],
// Add some "standard" rules by hand, as eslint-config-standard-with-typescript painful to keep up to date
quotes: ['error', 'single'],
'no-trailing-spaces': 'error'
// manual "semistandard" settings
semi: 'off',
'@typescript-eslint/semi': ['error', 'always'],
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': ['error']
}
};

Expand Down
8 changes: 4 additions & 4 deletions lib/argument.js
Expand Up @@ -49,7 +49,7 @@ class Argument {

name() {
return this._name;
};
}

/**
* @api private
Expand All @@ -75,7 +75,7 @@ class Argument {
this.defaultValue = value;
this.defaultValueDescription = description;
return this;
};
}

/**
* Set the custom handler for processing CLI command arguments into argument values.
Expand All @@ -87,7 +87,7 @@ class Argument {
argParser(fn) {
this.parseArg = fn;
return this;
};
}

/**
* Only allow argument value to be one of choices.
Expand All @@ -108,7 +108,7 @@ class Argument {
return arg;
};
return this;
};
}

/**
* Make argument required.
Expand Down

0 comments on commit 10b673f

Please sign in to comment.