@blumintinc/eslint-plugin-blumint 0.1.23 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +277 -55
  3. package/assets/logo.svg +26 -0
  4. package/jest.config.js +13 -0
  5. package/package.json +74 -25
  6. package/plugin/README.md +80 -0
  7. package/{docs → plugin/docs}/rules/class-methods-read-top-to-bottom.md +3 -1
  8. package/{docs → plugin/docs}/rules/dynamic-https-errors.md +1 -1
  9. package/{docs → plugin/docs}/rules/require-memo.md +9 -2
  10. package/plugin/package-lock.json +7662 -0
  11. package/plugin/package.json +45 -0
  12. package/tsconfig.json +79 -0
  13. package/lib/index.js +0 -69
  14. package/lib/rules/array-methods-this-context.js +0 -64
  15. package/lib/rules/class-methods-read-top-to-bottom.js +0 -72
  16. package/lib/rules/dynamic-https-errors.js +0 -57
  17. package/lib/rules/export-if-in-doubt.js +0 -69
  18. package/lib/rules/extract-global-constants.js +0 -63
  19. package/lib/rules/generic-starts-with-t.js +0 -35
  20. package/lib/rules/no-async-array-filter.js +0 -40
  21. package/lib/rules/no-async-foreach.js +0 -37
  22. package/lib/rules/no-conditional-literals-in-jsx.js +0 -61
  23. package/lib/rules/no-filter-without-return.js +0 -41
  24. package/lib/rules/no-misused-switch-case.js +0 -35
  25. package/lib/rules/no-unpinned-dependencies.js +0 -65
  26. package/lib/rules/no-useless-fragment.js +0 -46
  27. package/lib/rules/prefer-fragment-shorthand.js +0 -40
  28. package/lib/rules/prefer-type-over-interface.js +0 -45
  29. package/lib/rules/require-memo.js +0 -134
  30. package/lib/utils/ASTHelpers.js +0 -336
  31. package/lib/utils/ClassGraphBuilder.js +0 -80
  32. package/lib/utils/ClassGraphSorter.js +0 -99
  33. package/lib/utils/createRule.js +0 -6
  34. package/lib/utils/graph/ClassGraphBuilder.js +0 -80
  35. package/lib/utils/graph/ClassGraphSorter.js +0 -10
  36. package/lib/utils/graph/ClassGraphSorterReadability.js +0 -94
  37. package/lib/utils/graph.js +0 -109
  38. package/lib/utils/ruleTester.js +0 -23
  39. package/lib/utils/testClass.js +0 -45
  40. /package/{docs → plugin/docs}/rules/array-methods-this-context.md +0 -0
  41. /package/{docs → plugin/docs}/rules/export-if-in-doubt.md +0 -0
  42. /package/{docs → plugin/docs}/rules/extract-global-constants.md +0 -0
  43. /package/{docs → plugin/docs}/rules/generic-starts-with-t.md +0 -0
  44. /package/{docs → plugin/docs}/rules/no-async-array-filter.md +0 -0
  45. /package/{docs → plugin/docs}/rules/no-async-foreach.md +0 -0
  46. /package/{docs → plugin/docs}/rules/no-conditional-literals-in-jsx.md +0 -0
  47. /package/{docs → plugin/docs}/rules/no-filter-without-return.md +0 -0
  48. /package/{docs → plugin/docs}/rules/no-misused-switch-case.md +0 -0
  49. /package/{docs → plugin/docs}/rules/no-unpinned-dependencies.md +0 -0
  50. /package/{docs → plugin/docs}/rules/no-useless-fragment.md +0 -0
  51. /package/{docs → plugin/docs}/rules/prefer-fragment-shorthand.md +0 -0
  52. /package/{docs → plugin/docs}/rules/prefer-type-over-interface.md +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,63 @@
1
+ ## [1.0.2](https://github.com/BluMintInc/eslint-custom-rules/compare/v1.0.1...v1.0.2) (2024-11-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **package.json:** use public access ([6d78460](https://github.com/BluMintInc/eslint-custom-rules/commit/6d78460c8b28cd852229b0b59759d48620ab483d))
7
+
8
+ ## [1.0.1](https://github.com/BluMintInc/eslint-custom-rules/compare/v1.0.0...v1.0.1) (2024-11-13)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **package.json:** change package name ([8a44bd7](https://github.com/BluMintInc/eslint-custom-rules/commit/8a44bd74c8f4c908fea404a69a02c6ac8f1df407))
14
+ * **package.json:** remove np char ([39ec15d](https://github.com/BluMintInc/eslint-custom-rules/commit/39ec15d21b76f79086dc245d487ee9f605fbf839))
15
+
16
+ # 1.0.0 (2024-11-13)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **.releaserc.json:** update repo url to current repo ([e9b9139](https://github.com/BluMintInc/eslint-custom-rules/commit/e9b913904909639dd0faf44b1f210d4a2ae64f73))
22
+ * **husky:** remove husky ([ad7ecb3](https://github.com/BluMintInc/eslint-custom-rules/commit/ad7ecb33522a991d026af04c3f19beb96c4fd5dc))
23
+ * **package.json:** add back iun remove-hooks for github actions ([41b5ea1](https://github.com/BluMintInc/eslint-custom-rules/commit/41b5ea1d7d269d8568ddf23465e6cc8589ae91c5))
24
+ * **package.json:** use plugin/src instead of src ([1d9d2f6](https://github.com/BluMintInc/eslint-custom-rules/commit/1d9d2f6410094a8a7402a2ca51645f7746c8c369))
25
+ * **plugin/package-lock.json): only lint /src; fix(package.json:** upgrade engine to node v20 ([c654c8e](https://github.com/BluMintInc/eslint-custom-rules/commit/c654c8e6f0546e4f133fdca463b86f0d22e75c81))
26
+ * **plugin:** typo for rule definition ([a1d33b9](https://github.com/BluMintInc/eslint-custom-rules/commit/a1d33b90428a989a56244218bc4115c2ba479327))
27
+ * **release:** version to 0.1.24 ([78f4e28](https://github.com/BluMintInc/eslint-custom-rules/commit/78f4e281d2bc82e64403c053d514e75c23920915))
28
+ * **require-memo:** detect exported functions ([06f19b4](https://github.com/BluMintInc/eslint-custom-rules/commit/06f19b48f7dbedf83d84b31a64ffdd3f05a8b41a))
29
+ * **require-memo:** edge cases + additional tests ([908587b](https://github.com/BluMintInc/eslint-custom-rules/commit/908587beaf9020d60558f2b48916cf0bca140a34))
30
+ * **require-memo:** use src/util/memo instead of React memo ([3a1de04](https://github.com/BluMintInc/eslint-custom-rules/commit/3a1de0416a2a2833a3c23220d7616063ff2ea493))
31
+ * **setting.json:** codeActionsOnSave value change ([5557d2f](https://github.com/BluMintInc/eslint-custom-rules/commit/5557d2f2bdee222a03b4b4330d39f5a12b5e8684))
32
+
33
+
34
+ ### Features
35
+
36
+ * **0.1.16:** release v0.1.16 ([bfe4b1a](https://github.com/BluMintInc/eslint-custom-rules/commit/bfe4b1a8d815c2367fad83e50e4245ddce0d95fc))
37
+ * **0.1.17:** bump version ([eca598f](https://github.com/BluMintInc/eslint-custom-rules/commit/eca598fd863b48a4c4a1cd4a7770f3bf63c86669))
38
+ * **actions:** upgrade actions to node v20 ([e3417fa](https://github.com/BluMintInc/eslint-custom-rules/commit/e3417faee3b2b0badffb58a041a5d01fe550d83d))
39
+ * **array-methods-this-context:** implement rule + docs ([4db3cfb](https://github.com/BluMintInc/eslint-custom-rules/commit/4db3cfb74fc801e55af3009a547585afc462432a))
40
+ * **ASTHelpers:** class with helpers for AST traversal ([e0c02ea](https://github.com/BluMintInc/eslint-custom-rules/commit/e0c02ea3f629ec06f8834d4ba88ed53610cf19f7))
41
+ * **BLU-2402:** implement no-async-foreach ([1901988](https://github.com/BluMintInc/eslint-custom-rules/commit/1901988dbfec805fb8b9e99b88c1cd050a67e616))
42
+ * **BLU-2406:** implement no-useless-fragment ([559ecea](https://github.com/BluMintInc/eslint-custom-rules/commit/559ecea7d4e37d24c194065eb07f625c4bd5c59c))
43
+ * **class-methods-read-top-to-bottom:** implement rule ([80c5a37](https://github.com/BluMintInc/eslint-custom-rules/commit/80c5a37f5af0fac04ff847f463edb6999ce9ed5e))
44
+ * **ClassGraphBuilder:** builds a graph of class member nodes & their dependencies ([cff1588](https://github.com/BluMintInc/eslint-custom-rules/commit/cff15884688893af253ecaa7fe246134b484f59a))
45
+ * **ClassGraphSorter:** base class + configurable readability sorter ([536abd9](https://github.com/BluMintInc/eslint-custom-rules/commit/536abd930e8702698f725d98379445912818c4fd))
46
+ * **Dockerfile:** upgrade to node v20 and npm 10.4.0 ([e936c60](https://github.com/BluMintInc/eslint-custom-rules/commit/e936c60850449269062322c96319b88a67fa9fab))
47
+ * **dynamic-https-errors:** implement rule file & test suite ([c7e2266](https://github.com/BluMintInc/eslint-custom-rules/commit/c7e2266a2dedb6b8661fbdba1cf938c5753c67d4))
48
+ * **dynamic-https-errors:** include in index ([85fd0ed](https://github.com/BluMintInc/eslint-custom-rules/commit/85fd0ed34b443d9c5deee02daf96003ff4c9f6c7))
49
+ * **export-if-in-doubt:** implement rule, tests, docs ([3985661](https://github.com/BluMintInc/eslint-custom-rules/commit/39856610ca0089bf8aef3a14f4c506f0844176da))
50
+ * **extract-global-constants:** implement rule, tests, docs ([96f425a](https://github.com/BluMintInc/eslint-custom-rules/commit/96f425a52bdbd2672a2cb0ac68b8964583784df5))
51
+ * **generic-starts-with-t:** implement rule + docs ([2f5c8f3](https://github.com/BluMintInc/eslint-custom-rules/commit/2f5c8f360365c4e3a65b0bdc1b4eb4a49ef06fe5))
52
+ * **no-async-array-filter:** implement rule ([47f77a4](https://github.com/BluMintInc/eslint-custom-rules/commit/47f77a43f779f58540ca4b382afa2a839f1a35b4))
53
+ * **no-async-array-filter:** implement rule + docs ([9b67bc7](https://github.com/BluMintInc/eslint-custom-rules/commit/9b67bc7e29ebe4b75e7a9e71f5c4cf16f475778c))
54
+ * **no-conditional-literals-in-jsx.ts:** implement new rule for conditional text ([9638f37](https://github.com/BluMintInc/eslint-custom-rules/commit/9638f376f593a1122c7e29d011e14d7b9a036292))
55
+ * **no-filter-without-return:** implement rule + docs ([3106714](https://github.com/BluMintInc/eslint-custom-rules/commit/3106714e9413b0ba4080cacf8387e10de7325e26))
56
+ * **no-misused-switch-case:** implement rule, tests, docs ([06c9768](https://github.com/BluMintInc/eslint-custom-rules/commit/06c9768bc560b88a6f125157c3bfd8ec8ff012f2))
57
+ * **no-unpinned-dependencies:** implement rule ([b4f2f47](https://github.com/BluMintInc/eslint-custom-rules/commit/b4f2f47b597aeee6d76f338d8327d52b36a43948))
58
+ * **prefer-fragment-shorthand:** implement rule + docs ([6088af1](https://github.com/BluMintInc/eslint-custom-rules/commit/6088af155fa0f65606db67da0b6f3f2c2bb10b31))
59
+ * **prefer-type-over-interface:** implement rule + docs ([71c9f6e](https://github.com/BluMintInc/eslint-custom-rules/commit/71c9f6e32c56fdbb5c5eec9dcfa4c1c03d45547e))
60
+ * **require-memo:** add autofix for `function` ([485c278](https://github.com/BluMintInc/eslint-custom-rules/commit/485c2784ff6c620173ddcf5f3ec431346ccaacd6))
61
+ * **scripts:** implement make-docs util script ([4ad01ef](https://github.com/BluMintInc/eslint-custom-rules/commit/4ad01eff771baa1487957b22f12e253b71a948e0))
62
+ * **v0.1.15:** include require-memo rule ([84abe13](https://github.com/BluMintInc/eslint-custom-rules/commit/84abe136bf05e1a98878f3b24b086638c4bf823e))
63
+ * **v0.1.1:** update readme for release ([1e1df2a](https://github.com/BluMintInc/eslint-custom-rules/commit/1e1df2a5e969a2a86353e74c641b8e484b2aa7cf))
package/README.md CHANGED
@@ -1,77 +1,299 @@
1
- # @blumintinc/eslint-plugin-blumint
1
+ <!-- Project shields -->
2
2
 
3
- Custom eslint rules for use at BluMint
3
+ [![Setup Automated][gitpod-shield]][gitpod-url]
4
4
 
5
- ## Installation
5
+ <!-- Header -->
6
+ <br />
7
+ <p align="center">
8
+ <!---TODO: Update below with repository URL -->
9
+ <a href="https://github.com/BluMintInc/template-gitpod">
10
+ <img src="assets/logo.svg" alt="Logo" height=100>
11
+ </a>
12
+ <p align="center">
13
+ <!---TODO: Update below with repository name -->
14
+ TEMPLATE
15
+ <br />
16
+ <!---TODO: Update below with repository URL -->
17
+ <a href="https://github.com/BluMintInc/template-gitpod/issues">Report Bug</a>
18
+ ·
19
+ <!---TODO: Update below with repository URL -->
20
+ <a href="https://github.com/BluMintInc/template-gitpod/issues">Request Feature</a>
21
+ </p>
22
+ </p>
23
+ <br />
6
24
 
7
- You'll first need to install [ESLint](https://eslint.org/):
25
+ ## Table of Contents
8
26
 
9
- ```sh
10
- npm i eslint --save-dev
11
- ```
27
+ - [About this Project](#about-this-project)
28
+ - [Built With](#built-with)
29
+ - [Environment Dependencies](#environment-dependencies)
30
+ - [Recommended Browser Extensions](#recommended-browser-extensions)
31
+ - [Getting Started](#getting-started)
32
+ - [Zero-Installation Development](#zero-installation-development)
33
+ - [Docker Installation](#docker-installation)
34
+ - [Contributing](#contributing)
35
+ - [Agile Development](#agile-development)
36
+ - [Testing](#testing)
37
+ - [Gitflow](#gitflow)
38
+ - [Commitizen](#commitizen)
39
+ - [Diagramming](#diagramming)
40
+ - [Workflow Automation](#workflow-automation)
41
+ - [CI](#ci)
42
+ - [CD](#cd)
43
+ - [Dependency Management](#dependency-management)
44
+ - [Static Code Analysis](#static-code-analysis)
45
+ - [License](#license)
12
46
 
13
- Next, install `@blumintinc/eslint-plugin-blumint`:
47
+ <br />
14
48
 
15
- ```sh
16
- npm install @blumintinc/eslint-plugin-blumint --save-dev
17
- ```
49
+ ## About this Project
18
50
 
19
- ## Usage
51
+ This repository is a template repository for Gitpod-based development of a service.
20
52
 
21
- Add `@blumintinc/blumint` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
53
+ ### Built with
22
54
 
23
- ```json
24
- {
25
- "plugins": [
26
- "@blumintinc/blumint"
27
- ]
28
- }
29
- ```
55
+ - [Typescript](https://www.typescriptlang.org/)
56
+ - [Jest](https://mochajs.org/)
30
57
 
58
+ ### Environment Dependencies
31
59
 
32
- Then configure the rules you want to use under the rules section.
60
+ - [NodeJS](https://nodejs.org) (16 with npm ^8.16.0)
33
61
 
34
- ```json
35
- {
36
- "rules": {
37
- "blumint/rule-name": "error"
38
- }
39
- }
40
- ```
62
+ ### Recommended Browser Extensions
63
+
64
+ It is recommended that you install the following browser extensions for the best experience
65
+ interacting with this repository:
66
+
67
+ 1. [Gitpod Browser Extension](https://www.gitpod.io/docs/browser-extension/)
68
+
69
+ <br />
70
+
71
+ ## Getting Started
72
+
73
+ ### Zero-Installation Development
74
+
75
+ <!---TODO: Update below with repository URL -->
76
+
77
+ [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/BluMintInc/template-gitpod)
78
+
79
+ It is highly recommended to conduct development of this repository
80
+ via [Gitpod's online IDE](https://www.gitpod.io/docs/ide/). Click the following to
81
+ get started with zero installation requirements:
82
+
83
+ <p>
84
+ <!---TODO: Update below with repository URL -->
85
+ <a href="https://gitpod.io/#https://github.com/BluMintInc/template-gitpod" target="_blank" rel="nofollow noopener noreferrer">
86
+ <img src="https://gitpod.io/button/open-in-gitpod.svg" alt="Open in Gitpod">
87
+ </a>
88
+ </p>
89
+
90
+ Gitpod is a one-click online IDE for Cloud-based development. The following video
91
+ provides a very effective introduction to Gitpod: [https://www.youtube.com/watch?v=qLv6-Uop0yc](https://www.youtube.com/watch?v=qLv6-Uop0yc).
41
92
 
42
- Or use the recommended config:
93
+ <br />
43
94
 
44
- ```json
45
- {
46
- "extends": ["some-other-plugin", "plugin:@blumintinc/blumint/recommended"]
47
- }
95
+ ### Docker Installation
96
+
97
+ Alternatively, this repo supports [VS Code Remote Container Development](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume) for Dockerized development inside VSCode.
98
+
99
+ **Step #1**: To get started, first make sure to install the followin prerequisites:
100
+
101
+ 1. Visual Studio Code
102
+
103
+ - Manual installation: https://code.visualstudio.com/download
104
+ - Windows (via [Chocolately](https://chocolatey.org/)):
105
+ ```bash
106
+ choco install vscode
107
+ ```
108
+ - Mac or Linux (via [Homebrew](https://brew.sh/)):
109
+ ```sh
110
+ brew update
111
+ brew tap homebrew/cask-cask
112
+ brew cask search visual-studio-code
113
+ brew cask install visual-studio-code
114
+ ```
115
+
116
+ 2. [Visual Studio Code Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack)
117
+ extension pack, which can be installed into VS Code with [this manual installation link](vscode:extension/ms-vscode-remote.vscode-remote-extensionpack).
118
+
119
+ 3. [Docker Desktop](https://www.docker.com/products/docker-desktop)
120
+ - Manual installation: https://www.docker.com/products/docker-desktop for Widows / Mac
121
+ - Windows (via [Chocolately](https://chocolatey.org/)):
122
+ ```bash
123
+ choco install docker-desktop
124
+ ```
125
+ and follow
126
+ - Mac or Linux (via [Homebrew](https://brew.sh/)):
127
+ ```sh
128
+ brew cask install docker
129
+ ```
130
+ - Linux (Ubuntu, Debian):
131
+ ```sh
132
+ sudo apt-get update
133
+ sudo apt-get remove docker docker-engine docker.io
134
+ sudo apt install docker.io
135
+ sudo systemctl start docker
136
+ sudo systemctl enable docker
137
+ ```
138
+
139
+ **Step #2**: Start the Docker daemon if it has already not started automatially after the
140
+ installation finishes (run the Docker Desktop application). To ensure docker is running,
141
+ attempt the following commands:
142
+
143
+ ```bash
144
+ docker version
145
+ docker run hello-world
48
146
  ```
49
147
 
50
- ## Rules
148
+ **Step #3**: Start VS Code and press _F1_ to run
149
+ **Remote-Containers: Clone Repository in Container Volume..** from the Command Palette.
150
+
151
+ <!---TODO: Update below with repository URL -->
152
+
153
+ **Step #4**: Enter this repository's Git URI: https://github.com/BluMintInc/template-gitpod.git.
154
+ VS Code will install all required dependencies and set up the environment from the Dockerfile configuration.
155
+
156
+ <br />
157
+
158
+ ## Contributing
159
+
160
+ ### [Agile Development](https://agilemanifesto.org/)
161
+
162
+ We are uncovering better ways of developing
163
+ software by doing it and helping others do it.
164
+
165
+ Through this work we have come to value:
166
+
167
+ - **Individuals and interactions** over _processes and tools_
168
+ - **Working software** over _comprehensive documentation_
169
+ - **Customer collaboration** over _contract negotiation_
170
+ - **Responding to change** over _following a plan_
171
+
172
+ That is, while there is value in the items on
173
+ _the right_, we value the items **on the left** more.
174
+
175
+ Furthermore, we value these principles:
176
+
177
+ 1. Our highest priority is to satisfy the customer
178
+ through early and continuous delivery
179
+ of valuable software.
180
+ 2. Welcome changing requirements, even late in
181
+ development. Agile processes harness change for
182
+ the customer's competitive advantage.
183
+ 3. Deliver working software frequently, from a
184
+ couple of weeks to a couple of months, with a
185
+ preference to the shorter timescale.
186
+ 4. Business people and developers must work
187
+ together daily throughout the project.
188
+ 5. Build projects around motivated individuals.
189
+ Give them the environment and support they need,
190
+ and trust them to get the job done.
191
+ 6. The most efficient and effective method of
192
+ conveying information to and within a development
193
+ team is face-to-face conversation.
194
+ 7. Working software is the primary measure of progress.
195
+ 8. Agile processes promote sustainable development.
196
+ The sponsors, developers, and users should be able
197
+ to maintain a constant pace indefinitely.
198
+ 9. Continuous attention to technical excellence
199
+ and good design enhances agility.
200
+ 10. Simplicity--the art of maximizing the amount
201
+ of work not done--is essential.
202
+ 11. The best architectures, requirements, and designs
203
+ emerge from self-organizing teams.
204
+ 12. At regular intervals, the team reflects on how
205
+ to become more effective, then tunes and adjusts
206
+ its behavior accordingly.
207
+
208
+ ### Testing
209
+
210
+ Each contributor to this repository is obligated to provide sufficient test coverage over their contributions.
211
+ We use the [Jest](https://jestjs.io/) test framework.
212
+
213
+ ### [Gitflow](https://nvie.com/posts/a-successful-git-branching-model/)
214
+
215
+ Version control with git on this repo is in strict adherence to
216
+ the [Gitflow Workflow](https://nvie.com/posts/a-successful-git-branching-model/).
217
+ Gitflow was architectured by Vincent Driesssen in 2010 and since has been adopted with massive
218
+ popularity as a very effective development workflow under distributed version control.
219
+
220
+ This project makes use of the [git-flow](https://github.com/nvie/gitflow) integration setup in
221
+ the Docker container, which lets you execute `git flow` commands on the terminal rather than
222
+ `git` commands directly.
223
+
224
+ The project also utilizes [githooks](https://git-scm.com/docs/githooks/en) to enforce gitflow and
225
+ prevent users from accidently pushing to the main branch.
226
+
227
+ Plase read the following article for a sufficient introduction to the Gitflow
228
+ Workflow: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow.
229
+
230
+ ### [Commitizen](https://commitizen-tools.github.io/commitizen/)
231
+
232
+ This project uses [githooks](https://git-scm.com/docs/githooks/en) to enforce standarized commits
233
+ according to the [Commitizen](https://commitizen-tools.github.io/commitizen/) style. Running
234
+ `git commit` on the command line instigates a series of prompts guiding you through the standard.
235
+
236
+ ### Diagramming
237
+
238
+ All diagrams should be included on the repository to which they pertain. We use
239
+ [PlantUML](https://plantuml.com/) to build all of our diagrams. PlantUML has a Domain Specific
240
+ Language (DSL) for declaratively building [various types of diagrams](https://plantuml.com/).
241
+ You can write a .wsd, .pu, .puml, .plantuml, or .iuml file containing PlantUML DSL and the
242
+ [PlantUML Extension](https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml)
243
+ will enable you to render that diagram in a live preview by pressing Alt + D.
244
+
245
+ <br />
246
+ <br />
247
+
248
+ ## Workflow Automation
249
+
250
+ This repository uses [Github Actions](https://docs.github.com/en/actions) for several workflow
251
+ automations as well as several organizational [Github Integrations](https://github.com/integrations).
252
+
253
+ ### CI
254
+
255
+ Pre-commit [githooks](https://git-scm.com/docs/githooks/en) lint the codebase and then run all the
256
+ project's [Jest](https://jestjs.io/) tests to prevent regressions from even being checked into
257
+ the codebase. On top of this, the
258
+ [Test](https://github.com/BluMintInc/template-gitpod/blob/master/.github/workflows/test-report.yml)
259
+ Action runs the project's [Jest](https://jestjs.io/) tests to check PRs before they are merged.
260
+
261
+ ### CD
262
+ <!---TODO: Update below paragraph with repository URLs -->
263
+ The [Release](https://github.com/BluMintInc/template-gitpod/blob/master/.github/workflows/semantic-release.yml)
264
+ Action triggers on commits to the main branch utilzing the repository's
265
+ [Commitizen](https://commitizen-tools.github.io/commitizen/) commit style to automatically version published
266
+ code according to [SemVar](https://semver.org/). The
267
+ [Release](https://github.com/BluMintInc/template-gitpod/blob/master/.github/workflows/semantic-release.yml)
268
+ Action also publishes the project to our private npmjs repository scoped under [@blumint](https://www.npmjs.com/settings/minimap-inc/packages).
269
+
270
+ This repository also makes use of the [Semantic Pull Probot](https://github.com/zeke/semantic-pull-requests) to
271
+ vet and squash the commits of merged PRs onto the main branch. For more information, see
272
+ [Semantic Release](https://github.com/semantic-release/semantic-release).
273
+
274
+ ### Dependency Management
275
+
276
+ The [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-supply-chain-security#what-is-dependabot) integration will periodically
277
+ make PRs suggesting modifications to the dependecy structure to eliminiate vulnerabilities, update depricated
278
+ dependencies, and perform other miscellenous tasks.
279
+
280
+ ### Static Code Analysis
281
+
282
+ The [Accuracies](https://github.com/marketplace/accurics) integration analyzes the codebase for policy violations and
283
+ vulnerabilities with the use of Cloud infrastructure (AWS, GCP, etc.) and makes PRs to corrct any detected
284
+ issues before they become a problem.
51
285
 
52
- <!-- begin auto-generated rules list -->
286
+ The [Codacy](https://app.codacy.com/) bot will scan PRs and the repository as a whole to detect security vulnerabilities, code smells, performance inefficiencies, compatibility issues, unnecessarily complex code, missing documentation, and unused code.
53
287
 
54
- 💼 Configurations enabled in.\
55
- ⚠️ Configurations set to warn in.\
56
- ✅ Set in the `recommended` configuration.\
57
- 🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).
288
+ <br />
289
+ <br />
58
290
 
59
- | Name                           | Description | 💼 | ⚠️ | 🔧 |
60
- | :----------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- | :- | :- | :- |
61
- | [array-methods-this-context](docs/rules/array-methods-this-context.md) | Prevent misuse of Array methods in OOP | | ✅ | |
62
- | [export-if-in-doubt](docs/rules/export-if-in-doubt.md) | All top-level const definitions, type definitions, and functions should be exported | | | |
63
- | [extract-global-constants](docs/rules/extract-global-constants.md) | Extract constants/functions to the global scope when possible | | | |
64
- | [generic-starts-with-t](docs/rules/generic-starts-with-t.md) | Enforce TypeScript generic types to start with T | | ✅ | |
65
- | [no-async-array-filter](docs/rules/no-async-array-filter.md) | Disallow async callbacks for Array.filter | ✅ | | |
66
- | [no-async-foreach](docs/rules/no-async-foreach.md) | Disallow Array.forEach with an async callback function | ✅ | | |
67
- | [no-conditional-literals-in-jsx](docs/rules/no-conditional-literals-in-jsx.md) | Disallow use of conditional literals in JSX code | ✅ | | |
68
- | [no-filter-without-return](docs/rules/no-filter-without-return.md) | Disallow Array.filter callbacks without an explicit return (if part of a block statement) | ✅ | | |
69
- | [no-misused-switch-case](docs/rules/no-misused-switch-case.md) | Prevent misuse of logical OR in switch case statements | ✅ | | |
70
- | [no-unpinned-dependencies](docs/rules/no-unpinned-dependencies.md) | Enforces pinned dependencies | ✅ | | 🔧 |
71
- | [no-useless-fragment](docs/rules/no-useless-fragment.md) | Prevent unnecessary use of React fragments | | ✅ | 🔧 |
72
- | [prefer-fragment-shorthand](docs/rules/prefer-fragment-shorthand.md) | Prefer <> shorthand for <React.Fragment> | | ✅ | 🔧 |
73
- | [prefer-type-over-interface](docs/rules/prefer-type-over-interface.md) | Prefer using type alias over interface | | ✅ | 🔧 |
291
+ ## License
74
292
 
75
- <!-- end auto-generated rules list -->
293
+ No license is included, as all work is proprietary.
76
294
 
295
+ <!-- Markdown links & images -->
77
296
 
297
+ [gitpod-shield]: https://img.shields.io/badge/setup-automated-blue?logo=gitpod
298
+ <!---TODO: Update below with repository URL -->
299
+ [gitpod-url]: https://gitpod.io/#https://github.com/BluMintInc/template-gitpod
@@ -0,0 +1,26 @@
1
+ <svg width="283" height="459" viewBox="0 0 283 459" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M68.1796 0.729006L96.9887 19.0694C97.3939 19.3478 97.7274 19.7321 97.9583 20.1866C98.1892 20.6411 98.3099 21.1511 98.3094 21.6694C98.3335 36.063 98.4877 135.258 98.5263 159.755C98.5275 160.233 98.6318 160.704 98.8311 161.13C99.0303 161.556 99.3189 161.927 99.6739 162.212C100.029 162.497 100.441 162.689 100.877 162.773C101.312 162.856 101.76 162.829 102.185 162.693C163.751 143.49 234.07 173.041 265.52 232.165C283.961 266.829 286.998 312.058 275.006 350.205C273.83 353.949 272.861 361.094 270.224 363.944C264.883 372.832 259.022 381.342 252.675 389.424C252.675 389.424 241.521 403.641 231.071 413.474C212.476 430.982 161.567 451.725 111.507 432.381C101.481 428.476 27.9277 352.327 16.9719 340.934C16.567 340.512 16.2866 339.971 16.1657 339.378C16.0448 338.785 16.0888 338.167 16.2923 337.601L34.4829 287.202C34.6497 286.743 34.9162 286.334 35.2601 286.009C35.604 285.684 36.0152 285.453 36.4591 285.335L80.8658 273.485C81.2855 273.372 81.7236 273.363 82.1467 273.46C82.5699 273.557 82.967 273.757 83.308 274.044C83.6489 274.331 83.9248 274.698 84.1147 275.118C84.3045 275.537 84.4034 275.997 84.4037 276.464L84.4278 290.156V290.457C84.7073 293.416 89.6093 337.777 131.404 345.848C174.639 354.168 191.938 334.054 200.575 315.339C208.538 298.091 172.619 245.405 166.97 237.267C166.736 236.931 166.441 236.651 166.103 236.443C165.765 236.236 165.391 236.105 165.004 236.06L54.5534 222.904C53.8171 222.817 53.1411 222.425 52.6687 221.809C52.1963 221.194 51.9647 220.404 52.0229 219.607L68.1796 0.729006Z" fill="url(#paint0_linear_3084_32866)" />
3
+ <path d="M103.119 402.374C80.9466 385.038 66.3468 351.238 71.1235 321.384C75.553 293.726 97.0165 270.18 122.64 264.47C124.572 264.036 126.526 263.72 128.491 263.524L128.896 263.482C136.969 262.791 145.088 263.883 152.755 266.693C160.423 269.504 167.479 273.972 173.491 279.826C185.112 291.266 192.978 306.289 196.665 322.788C196.699 322.95 196.916 323.022 196.993 322.882C207.635 303.788 212.899 283.138 208.898 260.789C205.605 242.776 196.897 226.438 184.124 214.306C171.722 202.596 156.004 195.451 139.833 192.029C116.807 187.152 89.9697 189.278 69.3786 202.362C69.2563 202.44 69.117 202.481 68.9749 202.482C68.8328 202.484 68.6929 202.444 68.5695 202.368C68.4462 202.292 68.3436 202.182 68.2724 202.049C68.2012 201.917 68.1638 201.766 68.164 201.613L68.2845 0.892842C68.2852 0.864877 68.2805 0.837058 68.2708 0.811136C68.261 0.785213 68.2464 0.761745 68.2278 0.74221C68.2093 0.722674 68.1872 0.707493 68.1629 0.69762C68.1386 0.687747 68.1128 0.683396 68.0869 0.684841L6.93071 0.91364C6.05178 0.915 5.18174 1.10346 4.37045 1.46821C3.55915 1.83297 2.82255 2.36686 2.20285 3.03928C1.58315 3.7117 1.09253 4.50944 0.759112 5.38679C0.425692 6.26413 0.256022 7.20383 0.259828 8.15204C0.259828 19.7792 0.298389 30.8396 0.312849 42.472C0.356229 70.032 0.399603 94.3108 0.442983 121.897L0.712902 300.012C0.751462 325.711 -0.106498 352.824 9.3889 376.972C16.831 395.926 28.6689 412.499 43.4326 425.504C68.0483 447.198 99.8265 458.638 131.489 458.95C241.867 460.51 268.811 372.11 271.438 361.981C271.447 361.935 271.442 361.887 271.423 361.845C271.404 361.803 271.373 361.769 271.334 361.749C271.295 361.728 271.251 361.723 271.208 361.733C271.166 361.743 271.128 361.768 271.1 361.804C221.633 441.905 136.406 428.4 103.119 402.374Z" fill="url(#paint1_linear_3084_32866)" />
4
+ <defs>
5
+ <linearGradient id="paint0_linear_3084_32866" x1="0.0485188" y1="230.006" x2="282.008" y2="229.588" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#007EFF" />
7
+ <stop offset="0.04" stop-color="#0D8AFF" />
8
+ <stop offset="0.17" stop-color="#32AEFF" />
9
+ <stop offset="0.28" stop-color="#49C4FF" />
10
+ <stop offset="0.35" stop-color="#51CCFF" />
11
+ <stop offset="0.48" stop-color="#4CA7FF" />
12
+ <stop offset="0.63" stop-color="#4681FF" />
13
+ <stop offset="0.78" stop-color="#4265FF" />
14
+ <stop offset="0.9" stop-color="#4055FF" />
15
+ <stop offset="1" stop-color="#3F4FFF" />
16
+ </linearGradient>
17
+ <linearGradient id="paint1_linear_3084_32866" x1="0.565232" y1="230.022" x2="271.222" y2="229.628" gradientUnits="userSpaceOnUse">
18
+ <stop stop-color="#3200FF" />
19
+ <stop offset="0.41" stop-color="#0064E9" />
20
+ <stop offset="0.5" stop-color="#0D76ED" />
21
+ <stop offset="0.72" stop-color="#2BA1F7" />
22
+ <stop offset="0.9" stop-color="#3EBCFD" />
23
+ <stop offset="1" stop-color="#45C6FF" />
24
+ </linearGradient>
25
+ </defs>
26
+ </svg>
package/jest.config.js ADDED
@@ -0,0 +1,13 @@
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
+ module.exports = {
3
+ preset: 'ts-jest',
4
+ testEnvironment: 'node',
5
+ verbose: true,
6
+ reporters: ['default', 'jest-junit'],
7
+ testEnvironment: 'node',
8
+ roots: ['<rootDir>'],
9
+ testPathIgnorePatterns: ['<rootDir>/node_modules/'],
10
+ moduleNameMapper: {
11
+ '^src/(.*)$': '<rootDir>/src/$1',
12
+ },
13
+ };
package/package.json CHANGED
@@ -1,45 +1,94 @@
1
1
  {
2
2
  "name": "@blumintinc/eslint-plugin-blumint",
3
- "version": "0.1.23",
4
- "description": "Custom eslint rules for use at BluMint",
3
+ "version": "1.0.2",
4
+ "description": "Custom eslint rules for use within BluMint",
5
+ "author": {
6
+ "name": "Brodie McGuire",
7
+ "email": "brodie@blumint.io"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/BluMintInc/custom-eslint-rules.git"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/BluMintInc/custom-eslint-rules/issues"
18
+ },
19
+ "homepage": "https://github.com/BluMintInc/custom-eslint-rules#readme",
5
20
  "keywords": [
6
21
  "eslint",
7
22
  "eslintplugin",
8
23
  "eslint-plugin"
9
24
  ],
10
- "author": "Brodie McGuire",
11
- "main": "./lib/index.js",
12
- "exports": "./lib/index.js",
25
+ "private": false,
13
26
  "scripts": {
14
- "lint": "npm-run-all \"lint:*\"",
15
- "lint:eslint-docs": "npm-run-all \"update:eslint-docs -- --check\"",
16
- "lint:js": "eslint .",
17
- "test": "jest",
18
- "docs": "./scripts/make-docs.sh && npm run update:eslint-docs",
19
- "update:eslint-docs": "eslint-doc-generator"
27
+ "lint-ts": "tsc && eslint ./**/*",
28
+ "lint-md": "remark .",
29
+ "lint-shell": "shellcheck .devcontainer/git-flow-completion.bash",
30
+ "lint": "npm run lint-ts && npm run lint-md && npm run lint-shell",
31
+ "lint:fix": "tsc && eslint ./**/* --quiet --fix",
32
+ "test": "jest --passWithNoTests --reporters=default --reporters=jest-junit",
33
+ "test:ci": "jest --ci --passWithNoTests --reporters=default --reporters=jest-junit",
34
+ "version": "git add -A plugin/src",
35
+ "postversion": "git push && git push --tags",
36
+ "remove-hooks": "del-cli ./.husky/"
20
37
  },
21
38
  "dependencies": {
22
- "requireindex": "1.2.0"
39
+ "reflect-metadata": "0.1.13",
40
+ "typescript-memoize": "1.1.0"
23
41
  },
24
42
  "devDependencies": {
43
+ "@blumintinc/eslint-plugin-blumint": "file:plugin/lib",
44
+ "@semantic-release/changelog": "6.0.1",
45
+ "@semantic-release/commit-analyzer": "9.0.2",
46
+ "@semantic-release/git": "10.0.1",
47
+ "@semantic-release/npm": "9.0.1",
48
+ "@semantic-release/release-notes-generator": "10.0.3",
25
49
  "@types/eslint": "8.37.0",
50
+ "@types/node": "18.7.13",
51
+ "@typescript-eslint/eslint-plugin": "5.34.0",
52
+ "@typescript-eslint/parser": "5.48.0",
26
53
  "@typescript-eslint/utils": "5.59.6",
27
- "eslint": "8.19.0",
28
- "eslint-doc-generator": "1.0.0",
54
+ "chai": "4.3.6",
55
+ "chai-as-promised": "7.1.1",
56
+ "cross-env": "7.0.3",
57
+ "cz-conventional-changelog": "3.3.0",
58
+ "del-cli": "4.0.1",
59
+ "dotenv-cli": "5.0.0",
60
+ "eslint": "8.11.0",
61
+ "eslint-config-prettier": "8.5.0",
29
62
  "eslint-import-resolver-typescript": "3.5.5",
30
- "eslint-plugin-eslint-plugin": "5.0.0",
31
- "@blumintinc/eslint-plugin-blumint": "file:./",
32
- "eslint-plugin-node": "11.1.0",
63
+ "eslint-plugin-import": "2.26.0",
64
+ "eslint-plugin-jsdoc": "44.0.0",
65
+ "eslint-plugin-prettier": "4.2.1",
66
+ "eslint-plugin-security": "1.5.0",
67
+ "fs": "0.0.1-security",
33
68
  "jest": "29.3.1",
69
+ "jest-junit": "14.0.0",
34
70
  "jsonc-eslint-parser": "2.3.0",
35
- "npm-run-all": "4.1.5",
36
- "ts-jest": "29.0.5"
37
- },
38
- "engines": {
39
- "node": "^16.0.0"
71
+ "prettier": "2.7.1",
72
+ "remark-cli": "10.0.1",
73
+ "remark-lint": "9.1.1",
74
+ "remark-preset-lint-recommended": "6.1.2",
75
+ "semantic-release": "19.0.3",
76
+ "ts-jest": "29.0.5",
77
+ "ts-node": "10.9.1",
78
+ "typescript": "4.9.5"
40
79
  },
41
- "peerDependencies": {
42
- "eslint": ">=7"
80
+ "config": {
81
+ "commitizen": {
82
+ "path": "./node_modules/cz-conventional-changelog"
83
+ }
43
84
  },
44
- "license": "ISC"
85
+ "jest-junit": {
86
+ "outputDirectory": "reports",
87
+ "outputName": "jest-junit.xml",
88
+ "ancestorSeparator": " › ",
89
+ "uniqueOutputName": "false",
90
+ "suiteNameTemplate": "{filepath}",
91
+ "classNameTemplate": "{classname}",
92
+ "titleTemplate": "{title}"
93
+ }
45
94
  }