@dpuse/eslint-config-dpuse 1.0.72

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 (37) hide show
  1. package/.editorconfig +13 -0
  2. package/.gitattributes +4 -0
  3. package/.markdownlint.json +5 -0
  4. package/.ncurc.json +1 -0
  5. package/LICENSE +21 -0
  6. package/README.md +41 -0
  7. package/config.json +3 -0
  8. package/dist/index.d.ts +22 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +64 -0
  11. package/dist/index.js.map +1 -0
  12. package/eslint.config.ts +9 -0
  13. package/licenses/@typescript-eslint/eslint-plugin.LICENSE.txt +21 -0
  14. package/licenses/@typescript-eslint/parser.LICENSE.txt +21 -0
  15. package/licenses/downloads/@typescript-eslint/eslint-plugin.LICENSE.txt +21 -0
  16. package/licenses/downloads/@typescript-eslint/parser.LICENSE.txt +21 -0
  17. package/licenses/downloads/@typescript-eslint/utils.LICENSE.txt +21 -0
  18. package/licenses/downloads/eslint-import-resolver-typescript.LICENSE.txt +5 -0
  19. package/licenses/downloads/eslint-plugin-import-x.LICENSE.txt +22 -0
  20. package/licenses/downloads/eslint-plugin-prettier.LICENSE.txt +24 -0
  21. package/licenses/downloads/eslint-plugin-security.LICENSE.txt +202 -0
  22. package/licenses/downloads/eslint-plugin-sonarjs.LICENSE.txt +184 -0
  23. package/licenses/downloads/eslint-plugin-unicorn.LICENSE.txt +9 -0
  24. package/licenses/downloads/eslint.LICENSE.txt +19 -0
  25. package/licenses/downloads/licenses.ext.json +1 -0
  26. package/licenses/eslint-plugin-import.LICENSE.txt +22 -0
  27. package/licenses/eslint-plugin-prettier.LICENSE.txt +24 -0
  28. package/licenses/eslint-plugin-security.LICENSE.txt +202 -0
  29. package/licenses/eslint-plugin-sonarjs.LICENSE.txt +184 -0
  30. package/licenses/eslint-plugin-unicorn.LICENSE.txt +9 -0
  31. package/licenses/eslint.LICENSE.txt +19 -0
  32. package/licenses/licenses.ext.json +1 -0
  33. package/licenses/licenses.json +1 -0
  34. package/package.json +61 -0
  35. package/src/index.ts +99 -0
  36. package/tsconfig.eslint.json +7 -0
  37. package/tsconfig.json +32 -0
@@ -0,0 +1,184 @@
1
+ SONAR Source-Available License v1.0
2
+ Last Updated November 13, 2024
3
+
4
+ 1. DEFINITIONS
5
+
6
+ "Agreement" means this Sonar Source-Available License v1.0
7
+
8
+ "Competing" means marketing a product or service as a substitute for the
9
+ functionality or value of SonarQube. A product or service may compete regardless
10
+ of how it is designed or deployed. For example, a product or service may compete
11
+ even if it provides its functionality via any kind of interface (including
12
+ services, libraries, or plug-ins), even if it is ported to a different platform
13
+ or programming language, and even if it is provided free of charge.
14
+
15
+ "Contribution" means:
16
+
17
+ a) in the case of the initial Contributor, the initial content Distributed under
18
+ this Agreement, and
19
+
20
+ b) in the case of each subsequent Contributor:
21
+ i) changes to the Program, and
22
+ ii) additions to the Program;
23
+
24
+ where such changes and/or additions to the Program originate from and are
25
+ Distributed by that particular Contributor. A Contribution "originates" from a
26
+ Contributor if it was added to the Program by such Contributor itself or anyone
27
+ acting on such Contributor's behalf. Contributions do not include changes or
28
+ additions to the Program that are not Modified Works.
29
+
30
+ "Contributor" means any person or entity that Distributes the Program.
31
+
32
+ "Derivative Works" shall mean any work, whether in Source Code or other form,
33
+ that is based on (or derived from) the Program and for which the editorial
34
+ revisions, annotations, elaborations, or other modifications represent, as a
35
+ whole, an original work of authorship.
36
+
37
+ "Distribute" means the acts of a) distributing or b) making available in any
38
+ manner that enables the transfer of a copy.
39
+
40
+ "Licensed Patents" mean patent claims licensable by a Contributor that are
41
+ necessarily infringed by the use or sale of its Contribution alone or when
42
+ combined with the Program.
43
+
44
+ "Modified Works" shall mean any work in Source Code or other form that results
45
+ from an addition to, deletion from, or modification of the contents of the
46
+ Program, including, for purposes of clarity, any new file in Source Code form
47
+ that contains any contents of the Program. Modified Works shall not include
48
+ works that contain only declarations, interfaces, types, classes, structures, or
49
+ files of the Program solely in each case in order to link to, bind by name, or
50
+ subclass the Program or Modified Works thereof.
51
+
52
+ "Non-competitive Purpose" means any purpose except for (a) providing to others
53
+ any product or service that includes or offers the same or substantially similar
54
+ functionality as SonarQube, (b) Competing with SonarQube, and/or (c) employing,
55
+ using, or engaging artificial intelligence technology that is not part of the
56
+ Program to ingest, interpret, analyze, train on, or interact with the data
57
+ provided by the Program, or to engage with the Program in any manner.
58
+
59
+ "Notices" means any legal statements or attributions included with the Program,
60
+ including, without limitation, statements concerning copyright, patent,
61
+ trademark, disclaimers of warranty, or limitations of liability
62
+
63
+ "Program" means the Contributions Distributed in accordance with this Agreement.
64
+
65
+ "Recipient" means anyone who receives the Program under this Agreement,
66
+ including Contributors.
67
+
68
+ "SonarQube" means an open-source or commercial edition of software offered by
69
+ SonarSource that is branded "SonarQube".
70
+
71
+ "SonarSource" means SonarSource SA, a Swiss company registered in Switzerland
72
+ under UID No. CHE-114.587.664.
73
+
74
+ "Source Code" means the form of a Program preferred for making modifications,
75
+ including but not limited to software source code, documentation source, and
76
+ configuration files.
77
+
78
+ 2. GRANT OF RIGHTS
79
+
80
+ a) Subject to the terms of this Agreement, each Contributor hereby grants
81
+ Recipient a non-exclusive, worldwide, royalty-free copyright license, for any
82
+ Non-competitive Purpose, to reproduce, prepare Derivative Works of, publicly
83
+ display, publicly perform, Distribute and sublicense the Contribution of such
84
+ Contributor, if any, and such Derivative Works.
85
+
86
+ b) Subject to the terms of this Agreement, each Contributor hereby grants
87
+ Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
88
+ Patents, for any Non-competitive Purpose, to make, use, sell, offer to sell,
89
+ import, and otherwise transfer the Contribution of such Contributor, if any, in
90
+ Source Code or other form. This patent license shall apply to the combination of
91
+ the Contribution and the Program if, at the time the Contribution is added by
92
+ the Contributor, such addition of the Contribution causes such combination to be
93
+ covered by the Licensed Patents. The patent license shall not apply to any other
94
+ combinations that include the Contribution.
95
+
96
+ c) Recipient understands that although each Contributor grants the licenses to
97
+ its Contributions set forth herein, no assurances are provided by any
98
+ Contributor that the Program does not infringe the patent or other intellectual
99
+ property rights of any other entity. Each Contributor disclaims any liability to
100
+ Recipient for claims brought by any other entity based on infringement of
101
+ intellectual property rights or otherwise. As a condition to exercising the
102
+ rights and licenses granted hereunder, each Recipient hereby assumes sole
103
+ responsibility to secure any other intellectual property rights needed, if any.
104
+ For example, if a third-party patent license is required to allow Recipient to
105
+ Distribute the Program, it is Recipient's responsibility to acquire that license
106
+ before distributing the Program.
107
+
108
+ d) Each Contributor represents that to its knowledge it has sufficient copyright
109
+ rights in its Contribution, if any, to grant the copyright license set forth in
110
+ this Agreement.
111
+
112
+ 3. REQUIREMENTS
113
+
114
+ 3.1 If a Contributor Distributes the Program in any form, then the Program must
115
+ also be made available as Source Code, in accordance with section 3.2, and the
116
+ Contributor must accompany the Program with a statement that the Source Code for
117
+ the Program is available under this Agreement, and inform Recipients how to
118
+ obtain it in a reasonable manner on or through a medium customarily used for
119
+ software exchange; and
120
+
121
+ 3.2 When the Program is Distributed as Source Code:
122
+
123
+ a) it must be made available under this Agreement, and
124
+
125
+ b) a copy of this Agreement must be included with each copy of the Program.
126
+
127
+ 3.3 Contributors may not remove or alter any Notices contained within the
128
+ Program from any copy of the Program which they Distribute, provided that
129
+ Contributors may add their own appropriate Notices.
130
+
131
+ 4. NO WARRANTY
132
+
133
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY
134
+ APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES
135
+ OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
136
+ LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
137
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
138
+ responsible for determining the appropriateness of using and distributing the
139
+ Program and assumes all risks associated with its exercise of rights under this
140
+ Agreement, including but not limited to the risks and costs of program errors,
141
+ compliance with applicable laws, damage to or loss of data, programs or
142
+ equipment, and unavailability or interruption of operations.
143
+
144
+ 5. DISCLAIMER OF LIABILITY
145
+
146
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY
147
+ APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY
148
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
149
+ DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY
150
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
151
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
152
+ THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
153
+ THE POSSIBILITY OF SUCH DAMAGES.
154
+
155
+ 6. GENERAL
156
+
157
+ If any provision of this Agreement is invalid or unenforceable under applicable
158
+ law, it shall not affect the validity or enforceability of the remainder of the
159
+ terms of this Agreement, and without further action by the parties hereto, such
160
+ provision shall be reformed to the minimum extent necessary to make such
161
+ provision valid and enforceable.
162
+
163
+ If Recipient institutes patent litigation against any entity (including a
164
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
165
+ (excluding combinations of the Program with other software or hardware)
166
+ infringes such Recipient’s patent(s), then such Recipient’s rights granted under
167
+ Section 2(b) shall terminate as of the date such litigation is filed.
168
+
169
+ All Recipient’s rights under this Agreement shall terminate if it fails to
170
+ comply with any of the material terms or conditions of this Agreement and does
171
+ not cure such failure in a reasonable period of time after becoming aware of
172
+ such noncompliance. If all Recipient’s rights under this Agreement terminate,
173
+ Recipient agrees to cease use and distribution of the Program as soon as
174
+ reasonably practicable. However, Recipient’s obligations under this Agreement
175
+ and any licenses granted by Recipient relating to the Program shall continue and
176
+ survive.
177
+
178
+ Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives
179
+ no rights or licenses to the intellectual property of any Contributor under this
180
+ Agreement, whether expressly, by implication, estoppel, or otherwise. All rights
181
+ in the Program not expressly granted under this Agreement are reserved. Nothing
182
+ in this Agreement is intended to be enforceable by any entity that is not a
183
+ Contributor or Recipient. No third-party beneficiary rights are created under
184
+ this Agreement.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1 @@
1
+ [{"department":"n/a","relatedTo":"n/a","name":"@types/eslint-plugin-security","licensePeriod":"n/a","material":"n/a","licenseType":"MIT","link":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","remoteVersion":"3.0.0","installedVersion":"3.0.0","definedVersion":"^3.0.0","author":"n/a","licenseFileLink":""},{"department":"n/a","relatedTo":"n/a","name":"@typescript-eslint/eslint-plugin","licensePeriod":"n/a","material":"n/a","licenseType":"MIT","link":"git+https://github.com/typescript-eslint/typescript-eslint.git","remoteVersion":"8.49.0","installedVersion":"8.48.1","definedVersion":"^8.48.1","author":"n/a","licenseFileLink":"https://raw.githubusercontent.com/typescript-eslint/typescript-eslint/main/LICENSE"},{"department":"n/a","relatedTo":"n/a","name":"@typescript-eslint/parser","licensePeriod":"n/a","material":"n/a","licenseType":"MIT","link":"git+https://github.com/typescript-eslint/typescript-eslint.git","remoteVersion":"8.49.0","installedVersion":"8.48.1","definedVersion":"^8.48.1","author":"n/a","licenseFileLink":"https://raw.githubusercontent.com/typescript-eslint/typescript-eslint/main/LICENSE"},{"department":"n/a","relatedTo":"n/a","name":"eslint","licensePeriod":"n/a","material":"n/a","licenseType":"MIT","link":"git+https://github.com/eslint/eslint.git","remoteVersion":"9.39.1","installedVersion":"9.39.1","definedVersion":"^9.39.1","author":"Nicholas C. Zakas <nicholas+npm@nczconsulting.com>","licenseFileLink":"https://raw.githubusercontent.com/eslint/eslint/main/LICENSE"},{"department":"n/a","relatedTo":"n/a","name":"eslint-plugin-import","licensePeriod":"n/a","material":"n/a","licenseType":"MIT","link":"git+https://github.com/import-js/eslint-plugin-import.git","remoteVersion":"2.32.0","installedVersion":"2.32.0","definedVersion":"^2.32.0","author":"Ben Mosher <me@benmosher.com>","licenseFileLink":"https://raw.githubusercontent.com/import-js/eslint-plugin-import/main/LICENSE"},{"department":"n/a","relatedTo":"n/a","name":"eslint-plugin-prettier","licensePeriod":"n/a","material":"n/a","licenseType":"MIT","link":"git+https://github.com/prettier/eslint-plugin-prettier.git","remoteVersion":"5.5.4","installedVersion":"5.5.4","definedVersion":"^5.5.4","author":"Teddy Katz","licenseFileLink":"https://raw.githubusercontent.com/prettier/eslint-plugin-prettier/main/LICENSE.md"},{"department":"n/a","relatedTo":"n/a","name":"eslint-plugin-security","licensePeriod":"n/a","material":"n/a","licenseType":"Apache-2.0","link":"git+https://github.com/eslint-community/eslint-plugin-security.git","remoteVersion":"3.0.1","installedVersion":"3.0.1","definedVersion":"^3.0.1","author":"Node Security Project","licenseFileLink":"https://raw.githubusercontent.com/eslint-community/eslint-plugin-security/main/LICENSE"},{"department":"n/a","relatedTo":"n/a","name":"eslint-plugin-sonarjs","licensePeriod":"n/a","material":"n/a","licenseType":"LGPL-3.0-only","link":"git+https://github.com/SonarSource/SonarJS.git","remoteVersion":"3.0.5","installedVersion":"3.0.5","definedVersion":"^3.0.5","author":"SonarSource","licenseFileLink":"https://raw.githubusercontent.com/SonarSource/SonarJS/master/LICENSE.txt"},{"department":"n/a","relatedTo":"n/a","name":"eslint-plugin-unicorn","licensePeriod":"n/a","material":"n/a","licenseType":"MIT","link":"git+https://github.com/sindresorhus/eslint-plugin-unicorn.git","remoteVersion":"62.0.0","installedVersion":"62.0.0","definedVersion":"^62.0.0","author":"Sindre Sorhus sindresorhus@gmail.com https://sindresorhus.com","licenseFileLink":"https://raw.githubusercontent.com/sindresorhus/eslint-plugin-unicorn/main/license"}]
@@ -0,0 +1 @@
1
+ [{"department":"kessler","relatedTo":"stuff","name":"@types/eslint-plugin-security","licensePeriod":"perpetual","material":"material","licenseType":"MIT","link":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","remoteVersion":"3.0.1","installedVersion":"3.0.1","definedVersion":"^3.0.1","author":"n/a","latestRemoteModified":"2026-01-21T23:30:07.790Z"},{"department":"kessler","relatedTo":"stuff","name":"@typescript-eslint/eslint-plugin","licensePeriod":"perpetual","material":"material","licenseType":"MIT","link":"git+https://github.com/typescript-eslint/typescript-eslint.git","remoteVersion":"8.59.3","installedVersion":"8.59.3","definedVersion":"^8.57.1","author":"n/a","latestRemoteModified":"2026-05-11T17:49:41.683Z"},{"department":"kessler","relatedTo":"stuff","name":"@typescript-eslint/parser","licensePeriod":"perpetual","material":"material","licenseType":"MIT","link":"git+https://github.com/typescript-eslint/typescript-eslint.git","remoteVersion":"8.59.3","installedVersion":"8.59.3","definedVersion":"^8.57.1","author":"n/a","latestRemoteModified":"2026-05-11T17:49:21.801Z"},{"department":"kessler","relatedTo":"stuff","name":"@typescript-eslint/utils","licensePeriod":"perpetual","material":"material","licenseType":"MIT","link":"git+https://github.com/typescript-eslint/typescript-eslint.git","remoteVersion":"8.59.3","installedVersion":"8.59.3","definedVersion":"^8.57.1","author":"n/a","latestRemoteModified":"2026-05-11T17:49:21.827Z"},{"department":"kessler","relatedTo":"stuff","name":"eslint","licensePeriod":"perpetual","material":"material","licenseType":"n/a","link":"git+https://github.com/eslint/eslint.git","remoteVersion":"9.39.4","installedVersion":"n/a","definedVersion":"^9.39.4","author":"n/a","latestRemoteModified":"2026-05-01T15:39:41.192Z"},{"department":"kessler","relatedTo":"stuff","name":"eslint-import-resolver-typescript","licensePeriod":"perpetual","material":"material","licenseType":"ISC","link":"git+https://github.com/import-js/eslint-import-resolver-typescript.git","remoteVersion":"4.4.4","installedVersion":"4.4.4","definedVersion":"^4.4.4","author":"Alex Gorbatchev <alex.gorbatchev@gmail.com>","latestRemoteModified":"2025-06-25T17:46:33.663Z"},{"department":"kessler","relatedTo":"stuff","name":"eslint-plugin-import-x","licensePeriod":"perpetual","material":"material","licenseType":"MIT","link":"git+https://github.com/un-ts/eslint-plugin-import-x.git","remoteVersion":"4.16.2","installedVersion":"4.16.2","definedVersion":"^4.16.2","author":"JounQin <admin@1stg.me> (https://www.1stG.me)","latestRemoteModified":"2026-03-11T19:22:40.027Z"},{"department":"kessler","relatedTo":"stuff","name":"eslint-plugin-prettier","licensePeriod":"perpetual","material":"material","licenseType":"MIT","link":"git+https://github.com/prettier/eslint-plugin-prettier.git","remoteVersion":"5.5.5","installedVersion":"5.5.5","definedVersion":"^5.5.5","author":"Teddy Katz","latestRemoteModified":"2026-01-14T10:48:06.794Z"},{"department":"kessler","relatedTo":"stuff","name":"eslint-plugin-security","licensePeriod":"perpetual","material":"material","licenseType":"Apache-2.0","link":"git+https://github.com/eslint-community/eslint-plugin-security.git","remoteVersion":"4.0.0","installedVersion":"4.0.0","definedVersion":"^4.0.0","author":"Node Security Project","latestRemoteModified":"2026-02-19T15:08:53.524Z"},{"department":"kessler","relatedTo":"stuff","name":"eslint-plugin-sonarjs","licensePeriod":"perpetual","material":"material","licenseType":"LGPL-3.0-only","link":"git+https://github.com/SonarSource/SonarJS.git","remoteVersion":"4.0.3","installedVersion":"4.0.3","definedVersion":"^4.0.2","author":"SonarSource","latestRemoteModified":"2026-04-16T08:09:43.224Z"},{"department":"kessler","relatedTo":"stuff","name":"eslint-plugin-unicorn","licensePeriod":"perpetual","material":"material","licenseType":"n/a","link":"git+https://github.com/sindresorhus/eslint-plugin-unicorn.git","remoteVersion":"63.0.0","installedVersion":"n/a","definedVersion":"^63.0.0","author":"n/a","latestRemoteModified":"2026-03-27T20:02:38.942Z"}]
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@dpuse/eslint-config-dpuse",
3
+ "description": "Common ESLint configuration used in most DPUse projects.",
4
+ "version": "1.0.72",
5
+ "private": false,
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "prettier": "@dpuse/dpuse-development/prettierrc",
10
+ "peerDependencies": {
11
+ "eslint": "^10.6.0"
12
+ },
13
+ "dependencies": {
14
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
15
+ "@types/eslint-plugin-security": "^3.0.1",
16
+ "eslint-config-prettier": "^10.1.8",
17
+ "eslint-import-resolver-typescript": "^4.4.5",
18
+ "eslint-plugin-import-x": "^4.17.1",
19
+ "eslint-plugin-regexp": "^3.1.1",
20
+ "eslint-plugin-security": "^4.0.1",
21
+ "eslint-plugin-sonarjs": "^4.1.0",
22
+ "eslint-plugin-unicorn": "^69.0.0",
23
+ "typescript-eslint": "^8.62.1"
24
+ },
25
+ "devDependencies": {
26
+ "@dpuse/dpuse-development": "^0.3.629",
27
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
28
+ "@types/eslint-plugin-security": "^3.0.1",
29
+ "eslint": "^10.6.0",
30
+ "eslint-config-prettier": "^10.1.8",
31
+ "eslint-import-resolver-typescript": "^4.4.5",
32
+ "eslint-plugin-import-x": "^4.17.1",
33
+ "eslint-plugin-regexp": "^3.1.1",
34
+ "eslint-plugin-security": "^4.0.1",
35
+ "eslint-plugin-sonarjs": "^4.1.0",
36
+ "eslint-plugin-unicorn": "^69.0.0",
37
+ "typescript-eslint": "^8.62.1",
38
+ "jiti": "^2.7.0",
39
+ "license-downloader": "^2.0.0",
40
+ "license-report": "^6.8.2",
41
+ "license-report-check": "^1.0.0",
42
+ "license-report-recursive": "^6.8.4",
43
+ "nanoid": "^5.1.11",
44
+ "npm-check-updates": "^22.2.1",
45
+ "owasp-dependency-check": "^1.0.1",
46
+ "prettier": "^3.8.3",
47
+ "typescript": "^6.0.3"
48
+ },
49
+ "scripts": {
50
+ "audit": "op run --env-file=.env -- node -e \"import('@dpuse/dpuse-development').then(m => m.auditDependencies())\"",
51
+ "build": "tsc",
52
+ "check": "node -e \"import('@dpuse/dpuse-development').then(m => m.checkDependencies())\"",
53
+ "document": "op run --env-file=.env -- node -e \"import('@dpuse/dpuse-development').then(m => m.documentDependencies(['Apache-2.0', 'ISC', 'MIT', 'LGPL-3.0-only', 'n/a'], false))\"",
54
+ "format": "node -e \"import('@dpuse/dpuse-development').then(m => m.formatCode())\"",
55
+ "lint": "node -e \"import('@dpuse/dpuse-development').then(m => m.lintCode())\"",
56
+ "release": "op run --env-file=.env -- npm run build && npm run sync && npm publish --access public",
57
+ "sync": "node -e \"import('@dpuse/dpuse-development').then(m => m.syncProjectWithGitHub())\"",
58
+ "test:e2e": "echo \"❌ 'test:e2e' command not implemented.\"",
59
+ "test:unit": "echo \"❌ 'test:unit' command not implemented.\""
60
+ }
61
+ }
package/src/index.ts ADDED
@@ -0,0 +1,99 @@
1
+ /**
2
+ * ESLint configuration.
3
+ */
4
+
5
+ /** Vendor dependencies. */
6
+ import type { Linter } from 'eslint';
7
+ import pluginComments from '@eslint-community/eslint-plugin-eslint-comments';
8
+ import { flatConfigs as pluginImportFlatConfigs } from 'eslint-plugin-import-x';
9
+ import { configs as pluginRegexpConfigs } from 'eslint-plugin-regexp';
10
+ import pluginSecurity from 'eslint-plugin-security';
11
+ import pluginSonarJS from 'eslint-plugin-sonarjs';
12
+ import pluginUnicorn from 'eslint-plugin-unicorn';
13
+ import skipFormatting from 'eslint-config-prettier';
14
+ import tseslint from 'typescript-eslint';
15
+ import { defineConfig, globalIgnores } from 'eslint/config';
16
+
17
+ /** Options accepted by the shared DPUse ESLint configuration factory. */
18
+ export interface DPUseESLintConfigOptions {
19
+ /** Glob patterns for the files to type-check. Defaults to the common DPUse project layout. */
20
+ files?: string[];
21
+ /** Extra glob patterns to ignore, on top of the standard DPUse build/report directories. */
22
+ ignores?: string[];
23
+ /** Module specifiers that `import-x` should treat as resolvable core modules (e.g. `cloudflare:workers`). */
24
+ importCoreModules?: string[];
25
+ /** Project-specific rule overrides, applied last so they take precedence over the shared defaults. */
26
+ rules?: Linter.RulesRecord;
27
+ /** Path to the consuming project's `tsconfig.json`, used for typed linting and import resolution. */
28
+ tsconfigPath: string;
29
+ }
30
+
31
+ /** Configuration export. */
32
+ export function dpuseESLintConfig(options: DPUseESLintConfigOptions): Linter.Config[] {
33
+ const { files = ['eslint.config.*', 'src/**/*.ts'], ignores = [], importCoreModules = [], rules = {}, tsconfigPath } = options;
34
+
35
+ return defineConfig(
36
+ // Linting scope, strict TypeScript type-checking, and module resolver.
37
+ {
38
+ files,
39
+ extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked],
40
+ languageOptions: {
41
+ parserOptions: { project: tsconfigPath }
42
+ },
43
+ settings: {
44
+ 'import-x/core-modules': importCoreModules,
45
+ 'import-x/resolver': {
46
+ typescript: { project: [tsconfigPath] }
47
+ }
48
+ }
49
+ },
50
+
51
+ // Ignores.
52
+ globalIgnores(['bundle-analysis-reports/**', 'dependency-check-bin/**', 'dependency-check-reports/**', 'dist/**', 'licenses/**', ...ignores]),
53
+
54
+ // Plugin configurations.
55
+ {
56
+ // '@eslint-community/eslint-comments' only ships a legacy config; manually convert to flat format.
57
+ plugins: { '@eslint-community/eslint-comments': pluginComments },
58
+ rules: {
59
+ '@eslint-community/eslint-comments/disable-enable-pair': 'error',
60
+ '@eslint-community/eslint-comments/no-aggregating-enable': 'error',
61
+ '@eslint-community/eslint-comments/no-duplicate-disable': 'error',
62
+ '@eslint-community/eslint-comments/no-unlimited-disable': 'error',
63
+ '@eslint-community/eslint-comments/no-unused-enable': 'error'
64
+ }
65
+ },
66
+ pluginImportFlatConfigs.recommended,
67
+ pluginRegexpConfigs['flat/recommended'],
68
+ pluginSecurity.configs.recommended,
69
+ pluginSonarJS.configs.recommended,
70
+ pluginUnicorn.configs.recommended,
71
+ skipFormatting,
72
+
73
+ // Rule overrides.
74
+ {
75
+ rules: {
76
+ 'sort-imports': ['warn', { allowSeparatedGroups: true, ignoreCase: true, memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'] }],
77
+
78
+ '@typescript-eslint/no-unused-vars': 'warn',
79
+
80
+ '@eslint-community/eslint-comments/require-description': 'warn',
81
+
82
+ 'security/detect-object-injection': 'off',
83
+
84
+ 'sonarjs/no-commented-code': 'warn',
85
+ 'sonarjs/no-dead-store': 'warn',
86
+ 'sonarjs/no-unused-vars': 'warn',
87
+ 'sonarjs/todo-tag': 'warn',
88
+
89
+ 'unicorn/filename-case': ['error', { cases: { camelCase: true, pascalCase: true } }],
90
+ 'unicorn/no-null': 'off',
91
+ 'unicorn/switch-case-braces': ['warn', 'avoid'],
92
+
93
+ ...rules
94
+ }
95
+ }
96
+ );
97
+ }
98
+
99
+ export default dpuseESLintConfig;
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "."
5
+ },
6
+ "include": ["eslint.config.*", "src/**/*.ts"]
7
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "declaration": true,
4
+ "declarationMap": true,
5
+ "esModuleInterop": true,
6
+ "exactOptionalPropertyTypes": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "incremental": true,
9
+ "lib": ["ESNext"],
10
+ "module": "NodeNext",
11
+ "moduleDetection": "force",
12
+ "moduleResolution": "nodenext",
13
+ "noImplicitAny": true,
14
+ "noImplicitOverride": true,
15
+ "noPropertyAccessFromIndexSignature": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ "noUnusedLocals": true,
18
+ "noUnusedParameters": true,
19
+ "outDir": "dist",
20
+ "resolveJsonModule": true,
21
+ "rootDir": "src",
22
+ "skipLibCheck": true,
23
+ "sourceMap": true,
24
+ "strict": true,
25
+ "strictNullChecks": true,
26
+ "target": "ESNext",
27
+ "tsBuildInfoFile": "./node_modules/.cache/tsconfig.tsbuildinfo",
28
+ "useDefineForClassFields": true,
29
+ "verbatimModuleSyntax": true
30
+ },
31
+ "include": ["src/**/*.ts"]
32
+ }