Prohibit Chai expect or should; prefer assert

This commit is contained in:
Evan Hahn 2022-01-19 13:19:08 -06:00 committed by GitHub
parent 885b4d4d2e
commit c1e3e87b99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 37 deletions

View file

@ -1,8 +1,21 @@
// Copyright 2021 Signal Messenger, LLC
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const { update } = require('lodash/fp');
const topLevelEslintrc = require('../../.eslintrc');
const typescriptRules = topLevelEslintrc.overrides.find(override =>
override.files.some(glob => glob.endsWith('.ts'))
).rules;
const noRestrictedImportsRule =
typescriptRules['@typescript-eslint/no-restricted-imports'];
module.exports = {
rules: {
'@typescript-eslint/no-restricted-imports': 'off',
'@typescript-eslint/no-restricted-imports': update(
[1, 'paths'],
(paths = []) => paths.filter(path => path.name !== 'electron'),
noRestrictedImportsRule
),
},
};