Skip to content

Commit

Permalink
added lint support and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sadabnepal committed Mar 22, 2024
1 parent 0d778e9 commit d802ce7
Show file tree
Hide file tree
Showing 19 changed files with 1,500 additions and 140 deletions.
115 changes: 115 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
module.exports = {
env: {
es2021: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
env: {
node: true
},
files: [
'.eslintrc.js'
]
}
],
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/quotes': [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
'indent': [
'error',
4,
{
SwitchCase: 1
}
],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '.js',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true
}
],
'linebreak-style': [
'error',
'unix'
],
'semi': [
'error',
'always',
{
omitLastInOneLineBlock: true,
omitLastInOneLineClassBody: true,

}
],
'getter-return': ['error'],
'no-fallthrough': [
'error',
{
allowEmptyCase: true
}
],
'no-irregular-whitespace': [
'error',
{
skipStrings: true,
skipComments: true,
skipRegExps: true,
skipTemplates: true
}
],
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false
}
],
'camelcase': [
'error',

{
properties: 'always',
ignoreDestructuring: false,
ignoreImports: false,
allow: ['^CONSTANT_']
}
],
'default-case': [
'error'
],
'no-var': [
'error'
],
'require-await': [
'error'
]
},
ignorePatterns: ['mocks/**/*.js', 'report/**/*']
};
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"mikestead.dotenv",
"hbenl.vscode-mocha-test-adapter",
"spoonscen.es6-mocha-snippets"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Boilerplate API test framework using Mocha, SuperTest and TypeScript.

#### Pre-requisite:
[![NodeJs](https://img.shields.io/badge/-NodeJS%20v10%20OR%20later-%23339933?logo=npm)](https://nodejs.org/en/download/)
[![NodeJs](https://img.shields.io/badge/-NodeJS-%23339933?logo=npm)](https://nodejs.org/en/download/)
[![VSCode](https://img.shields.io/badge/-Visual%20Studio%20Code-%233178C6?logo=visual-studio-code)](https://code.visualstudio.com/download)

#### Getting Started:
Expand Down
Loading

0 comments on commit d802ce7

Please sign in to comment.