-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compliance-web): Migrate project from tslint to eslint (#387)
* feat(compliance-web): Migrate project from tslint to eslint - Add .eslintrc.js - remove tsling.config.json - Disable failing rules (to keep PR small and to be fixed later) - Add recommended plugins for vscode - Remove some excluded files from tsconfig.json because eslint throws an error if the files are not included (we can change this to exclude them from scanning altogether if we want, but it seems good to scan them if possible) Note: Security rules will be fixed in an upcoming PR. * Chore: Re-add test files to the exclude list in tsconfig.json The previous change caused yarn build to fail because it was picking up the contents of src/test-resources/generator/, which it's not supposed to do; that directory is a tool for generating new test resources, has its own separate package.json, and is intended to be built separately The addition of tsconfig.eslint.json allows test files to be included in the eslint scan, but remain excluded for the build.
- Loading branch information
Showing
6 changed files
with
473 additions
and
90 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,52 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
module.exports = { | ||
env: { | ||
es2017: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'plugin:security/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
sourceType: 'module', // Allows for the use of imports | ||
project: './tsconfig.eslint.json', | ||
ecmaFeatures: {}, | ||
ecmaVersion: 8, | ||
}, | ||
plugins: ['@typescript-eslint', 'security'], | ||
settings: {}, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/restrict-template-expressions': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/restrict-plus-operands': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'security/detect-object-injection': 'off', | ||
'security/detect-non-literal-fs-filename': 'off', | ||
'no-var': 'off', | ||
'prefer-const': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['src/tests/**/*'], | ||
rules: { | ||
// Disable those errors and warnings which are not a threat to test code because the code is not run in production environments | ||
}, | ||
}, | ||
], | ||
}; |
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,9 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
{ | ||
"recommendations": [ | ||
"esbenp.prettier-vscode", | ||
"dbaeumer.vscode-eslint", | ||
"psioniq.psi-header" | ||
] | ||
} |
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
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,4 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": ["node_modules"] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.