Skip to content

Commit 8bc2009

Browse files
authored
feat: add no-restricted-imports rule for lodash and fontawesome (#131)
Closes #129 ### Developer Checklist (Definition of Done) **Issue** - [x] All acceptance criteria from the issue are met - [x] Tested in latest Chrome/Firefox **UI/UX/Vis** - [ ] Requires UI/UX/Vis review - [ ] Reviewer(s) are notified (_tag assignees_) - [ ] Review has occurred (_link to notes_) - [ ] Feedback is included in this PR - [ ] Reviewer(s) approve of concept and design **Code** - [x] Branch is up-to-date with the branch to be merged with, i.e., develop - [x] Code is cleaned up and formatted - [ ] Unit tests are written (frontend/backend if applicable) - [ ] Integration tests are written (if applicable) **PR** - [x] Descriptive title for this pull request is provided (will be used for release notes later) - [x] Reviewer and assignees are defined - [x] Add type label (e.g., *bug*, *feature*) to this pull request - [x] Add release label (e.g., `release: minor`) to this PR following [semver](https://semver.org/) - [x] The PR is connected to the corresponding issue (via `Closes #...`) - [x] [Summary of changes](#summary-of-changes) is written ### Summary of changes - Restricts import of lodash and fontawesome, see linked issue for details. ### Screenshots ### Additional notes for the reviewer(s) - Thanks for creating this pull request 🤗
1 parent edeee83 commit 8bc2009

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

config/eslintrc.template.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ module.exports = ({ tsconfigRootDir, optimizeImports = true }) => ({
5151
'no-prototype-builtins': 'warn',
5252
'no-minusminus': 'off',
5353
'no-underscore-dangle': 'off',
54+
'no-restricted-imports': [
55+
'error',
56+
{
57+
paths: [{
58+
name: 'lodash',
59+
message: 'Please import specific methods from lodash/<util> instead.',
60+
},
61+
{
62+
name: '@fortawesome/free-solid-svg-icons',
63+
message: 'Please import specific icons from @fortawesome/free-solid-svg-icons/<icon> instead.',
64+
},
65+
{
66+
name: '@fortawesome/free-regular-svg-icons',
67+
message: 'Please import specific icons from @fortawesome/free-regular-svg-icons/<icon> instead.',
68+
}],
69+
},
70+
],
5471
'@typescript-eslint/no-explicit-any': 'warn',
5572
'@typescript-eslint/no-unused-expressions': [
5673
'error',

0 commit comments

Comments
 (0)