Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions extensions/packageManager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@
"@types/node": "^14.6.2",
"@types/react": "^16.9.53",
"rimraf": "^3.0.2",
"@typescript-eslint/eslint-plugin": "2.34.0",
"@typescript-eslint/parser": "2.34.0",
"eslint": "7.0.0",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-cypress": "2.11.1",
"eslint-plugin-emotion": "10.0.27",
"eslint-plugin-format-message": "6.2.3",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-lodash": "7.1.0",
"eslint-plugin-notice": "0.9.10",
"eslint-plugin-prettier": "3.1.3",
"eslint-plugin-react": "7.20.0",
"eslint-plugin-react-hooks": "4.0.2",
"eslint-plugin-security": "1.4.0",
"prettier": "2.0.5",
Comment thread
benbrown marked this conversation as resolved.
Outdated
"ts-loader": "^8.0.0",
"typescript": "^3.9.6",
"webpack": "^4.43.0",
Expand Down
126 changes: 126 additions & 0 deletions extensions/packageManager/src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

module.exports = {
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'prettier/@typescript-eslint',
],
plugins: ['import', 'notice', 'security', 'lodash'],
env: {
browser: true,
es6: true,
node: true,
},
rules: {
'notice/notice': [
'error',
{
mustMatch: 'Copyright \\(c\\) Microsoft Corporation',
templateFile: require.resolve('./license.js'),
},
],

// typescript
'@typescript-eslint/ban-ts-ignore': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/prefer-optional-chain': 'error',

// eslint rules
'no-dupe-class-members': 'off',
'prefer-const': 'error',
'no-var': 'error',
'no-console': 'warn',
'dot-notation': 'error',
yoda: 'error',
'no-bitwise': 'error',
// eqeqeq: 'error',
'no-underscore-dangle': [
'error',
{
// add special window.__foo__ names as exceptions here
allow: ['__nonce__', '__IS_ELECTRON__'],
// allow this._name so custom getters and setters can be written gracefully
allowAfterThis: true,
enforceInMethodNames: true,
},
],
'prefer-arrow-callback': 'error',

// plugin: import
'import/first': 'error',
'import/order': ['error', { 'newlines-between': 'always' }],

// security
'security/detect-buffer-noassert': 'error',
'security/detect-child-process': 'error',
'security/detect-disable-mustache-escape': 'error',
'security/detect-eval-with-expression': 'error',
'security/detect-new-buffer': 'error',
'security/detect-no-csrf-before-method-override': 'error',
'security/detect-non-literal-fs-filename': 'error',
'security/detect-non-literal-regexp': 'error',
'security/detect-non-literal-require': 'error',
'security/detect-object-injection': 'off',
'security/detect-possible-timing-attacks': 'error',
'security/detect-pseudoRandomBytes': 'error',
'security/detect-unsafe-regex': 'error',

// lodash
'lodash/callback-binding': 'error',
'lodash/collection-method-value': 'error',
'lodash/collection-return': 'error',
'lodash/no-double-unwrap': 'error',
'lodash/no-extra-args': 'error',
'lodash/no-unbound-this': 'error',
'lodash/unwrap': 'error',
'lodash/identity-shorthand': 'error',
'lodash/import-scope': ['error', 'method'],
'lodash/matches-prop-shorthand': 'error',
'lodash/matches-shorthand': 'error',
'lodash/path-style': 'error',
'lodash/prefer-compact': 'error',
'lodash/prefer-flat-map': 'error',
'lodash/prefer-immutable-method': 'error',
'lodash/prefer-map': 'error',
'lodash/prefer-reject': 'error',
'lodash/preferred-alias': 'error',
'lodash/prop-shorthand': 'error',
},
overrides: [
{
files: ['**/*.+(test|spec).+(js|jsx|ts|tsx)'],
env: {
jest: true,
},
rules: {
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-explicit-any': 'off',

'security/detect-buffer-noassert': 'off',
'security/detect-child-process': 'off',
'security/detect-disable-mustache-escape': 'off',
'security/detect-eval-with-expression': 'off',
'security/detect-new-buffer': 'off',
'security/detect-no-csrf-before-method-override': 'off',
'security/detect-non-literal-fs-filename': 'off',
'security/detect-non-literal-regexp': 'off',
'security/detect-non-literal-require': 'off',
'security/detect-object-injection': 'off',
'security/detect-possible-timing-attacks': 'off',
'security/detect-pseudoRandomBytes': 'off',
'security/detect-unsafe-regex': 'off',
},
},
],
};
Loading