2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
2021-12-17 22:24:54 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2022-01-19 19:19:08 +00:00
|
|
|
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'];
|
|
|
|
|
2021-12-17 22:24:54 +00:00
|
|
|
module.exports = {
|
|
|
|
rules: {
|
2022-01-19 19:19:08 +00:00
|
|
|
'@typescript-eslint/no-restricted-imports': update(
|
|
|
|
[1, 'paths'],
|
|
|
|
(paths = []) => paths.filter(path => path.name !== 'electron'),
|
|
|
|
noRestrictedImportsRule
|
|
|
|
),
|
2021-12-17 22:24:54 +00:00
|
|
|
},
|
|
|
|
};
|