Skip to content

Commit

Permalink
Oclif eslint (#733)
Browse files Browse the repository at this point in the history
* Switch to using oclif eslint

* Ran eslint --fix

* Eslint now passes

* Enable eqeqeq rule

* Enable quotes rule

* Enable unicorn/no-array-for-each rule

* Enable unicorn/no-instanceof-array rule

* Enable unicorn/prefer-number-properties rule

* Enable unicorn/prefer-set-has rule

* Enable unicorn/prefer-spread rule

* Type fixes from pulling in rc

* Enable unicorn/no-for-loop rule

* Enable unicorn/prefer-object-from-entries rule

* Enable unicorn/no-array-reduce rule

* Enable unicorn/no-object-as-default-parameter rule

* Enable complexity rule

* Enable no-implicit-coercion rule

* Enable unicorn/better-regex rule

* Enable unicorn/explicit-length-check rule

* Enable unicorn/import-style rule

* Final changes to eslint

* Fix build error

* Attempt to fix gha build

* Fix lint
  • Loading branch information
tjhiggins authored Oct 13, 2022
1 parent 1a48ce3 commit 4e7003d
Show file tree
Hide file tree
Showing 82 changed files with 2,332 additions and 1,565 deletions.
75 changes: 48 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,56 @@
// eslint-disable-next-line unicorn/prefer-module
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'oclif',
'oclif-typescript',
],
parser: '@typescript-eslint/parser',
plugins: ['oclif'],
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
ignorePatterns: ['.eslintrc.js', "release.config.js"],
rules: {
camelcase: [0],
'no-extra-semi': [2],
'no-unused-vars': [0],
'no-undef': [0],
'comma-dangle': [1, 'always-multiline'],
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/semi': ['error'],

'array-element-newline': 0,
'camelcase': [0],
'complexity': ['error', 50],
'generator-star-spacing': 0,
'indent': 0,
'lines-between-class-members': 0,
'max-depth': ['error', 6],
'new-cap': 0,
'no-else-return': 0,
'object-curly-spacing': ['error', 'always'],
'padding-line-between-statements': 0,
'radix': 0,
'semi': 'off',
'no-prototype-builtins': [0],
'no-case-declarations': [0],
'space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always' }],
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],

'@typescript-eslint/camelcase': [0],
'@typescript-eslint/explicit-function-return-type': [0],
'@typescript-eslint/no-explicit-any': [0],
'@typescript-eslint/no-unused-vars': [0],
'@typescript-eslint/no-var-requires': [0],
'@typescript-eslint/no-namespace': [1],
'@typescript-eslint/semi': ['warn', 'always'],
'unicorn/catch-error-name': 'off',
'unicorn/empty-brace-spaces': 'off',
'unicorn/no-zero-fractions': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-optional-catch-binding': 'off',
'unicorn/prefer-string-slice': 'off',
'unicorn/prefer-switch': 'off',
'unicorn/prefer-type-error': 'off',

// Consider enabling
'default-param-last': 0,
'arrow-parens': 0,
'no-await-in-loop': 0,
'no-negated-condition': 0,
'no-promise-executor-return': 0,
'no-template-curly-in-string': 0,
'no-warning-comments': 0,
'one-var-declaration-per-line': 0,
'prefer-regex-literals': 0,
'@typescript-eslint/explicit-module-boundary-types': ['warn', {
allowArgumentsExplicitlyTypedAsAny: true,
}]
}
}
}],
'valid-jsdoc': 0,
'unicorn/no-process-exit': 'off',
'unicorn/no-static-only-class': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/prefer-ternary': 'off',
'quote-props': 0,
},
};
Loading

0 comments on commit 4e7003d

Please sign in to comment.