Skip to content

Commit

Permalink
Merge pull request #23 from SparkPost/typescript-linting
Browse files Browse the repository at this point in the history
Typescript linting
  • Loading branch information
rdunlapSP authored Jun 1, 2020
2 parents 3e1d686 + d02b47e commit 282718d
Show file tree
Hide file tree
Showing 5 changed files with 635 additions and 1,734 deletions.
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
semi: true,
trailingComma: 'none',
singleQuote: true,
tabWidth: 2
};
31 changes: 24 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ module.exports = {
ecmaVersion: 2018
},
plugins: ['mocha'],
extends: 'eslint:recommended',
extends: ['eslint:recommended'],
rules: {
'arrow-body-style': ['error', 'as-needed'],
'arrow-parens': ['error', 'always'],
'arrow-spacing': 'error',
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
camelcase: 'off',
'comma-dangle': ['error', 'never'],
'comma-style': [
'error',
'first',
{ exceptions: { ArrayExpression: true, ObjectExpression: true } }
],
'comma-style': ['error', 'first', { exceptions: { ArrayExpression: true, ObjectExpression: true } }],
complexity: ['error', 5],
'consistent-this': ['error', 'self'],
curly: ['error', 'all'],
Expand Down Expand Up @@ -75,7 +71,7 @@ module.exports = {
'space-infix-ops': 'error',
'space-return-throw-case': 'off',
'space-unary-ops': 'off',
strict: 'error',
strict: ['error', 'global'],
'template-curly-spacing': ['error', 'never'],
'vars-on-top': 'error',
'wrap-iife': ['error', 'any'],
Expand All @@ -89,6 +85,27 @@ module.exports = {
'func-names': 'off',
'prefer-arrow-callback': 'off'
}
},
{
files: ['*.ts'],
extends: ['plugin:prettier/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended'],
env: {
es6: true
},
parser: '@typescript-eslint/parser',
plugins: ['mocha', '@typescript-eslint'],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{
functions: false,
classes: false,
variables: true
}
]
}
}
]
};
Loading

0 comments on commit 282718d

Please sign in to comment.