-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Eslint and require it to pass through GitHub CI (#27)
- Loading branch information
1 parent
14fdd94
commit 76f1c61
Showing
49 changed files
with
1,005 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"extends": "@medic", | ||
"env": { | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 6 | ||
}, | ||
"ignorePatterns": [ | ||
"**/node_modules/**", | ||
"**/dist/**" | ||
], | ||
"plugins": ["promise", "node"], | ||
"rules": { | ||
"array-bracket-newline": ["error", "consistent"], | ||
"array-callback-return": ["error", { "allowImplicit": true }], | ||
"arrow-spacing": ["error", { "before": true, "after": true }], | ||
"brace-style": ["error", "1tbs"], | ||
"comma-spacing": ["error", { "before": false, "after": true }], | ||
"comma-style": ["error", "last"], | ||
"default-param-last": "error", | ||
"dot-location": ["error", "property"], | ||
"dot-notation": ["error", { "allowKeywords": true }], | ||
"func-call-spacing": ["error", "never"], | ||
"function-call-argument-newline": ["error", "consistent"], | ||
"function-paren-newline": ["error", "consistent"], | ||
"implicit-arrow-linebreak": ["error", "beside"], | ||
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }], | ||
"keyword-spacing": ["error", { "before": true, "after": true }], | ||
"linebreak-style": ["error", "unix"], | ||
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], | ||
"new-parens": "error", | ||
"no-alert": "error", | ||
"no-else-return": "error", | ||
"no-extra-bind": "error", | ||
"no-lone-blocks": "error", | ||
"no-nested-ternary": "error", | ||
"no-undef-init": "error", | ||
"no-useless-rename": "error", | ||
"no-whitespace-before-property": "error", | ||
"node/no-exports-assign": "error", | ||
"max-len": ["error", { "code": 150 }], | ||
"rest-spread-spacing": ["error", "never"], | ||
"semi-spacing": ["error", { "before": false, "after": true }], | ||
"semi-style": ["error", "last"], | ||
"template-curly-spacing": "error", | ||
"unicode-bom": ["error", "never"] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ "**/test/**", "**/tests/**" ], | ||
"rules": { | ||
"promise/catch-or-return": "error" | ||
} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"parserOptions": { | ||
"createDefaultProgram": true | ||
}, | ||
"rules": { | ||
"no-console": "off", | ||
"no-restricted-syntax": "off", | ||
// Prevent TypeScript-specific constructs from being erroneously flagged as unused | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
// Require a specific member delimiter style for interfaces and type literals | ||
// Default Semicolon style | ||
"@typescript-eslint/member-delimiter-style": "error", | ||
"@typescript-eslint/ban-ts-comment": "error", | ||
"quote-props": ["error", "as-needed"] | ||
} | ||
}, | ||
{ | ||
"files": ["*.spec.ts"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
// allow ts-comments in unit tests | ||
"@typescript-eslint/ban-ts-comment": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ jobs: | |
node-version: 20.x | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm run lint | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules | |
dist | ||
.env* | ||
src/package.json | ||
.eslintcache |
Oops, something went wrong.