@plugjs/eslint-plugin-vue 0.1.0

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.
package/LICENSE.md ADDED
@@ -0,0 +1,211 @@
1
+ # Apache License
2
+
3
+ Version 2.0, January 2004
4
+
5
+ [http://www.apache.org/licenses/](http://www.apache.org/licenses/)
6
+
7
+ ##### TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ ### 1. Definitions.
10
+
11
+ "**License**" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "**Licensor**" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "**Legal Entity**" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "**control**" means **(i)** the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, _or_ **(ii)** ownership of fifty percent (50%) or more of
23
+ the outstanding shares, _or_ **(iii)** beneficial ownership of such
24
+ entity.
25
+
26
+ "**You**" (or "**Your**") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "**Source**" form shall mean the preferred form for making
30
+ modifications, including but not limited to software source code,
31
+ documentation source, and configuration files.
32
+
33
+ "**Object**" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but not
35
+ limited to compiled object code, generated documentation, and
36
+ conversions to other media types.
37
+
38
+ "**Work**" shall mean the work of authorship, whether in Source or
39
+ Object form, made available under the License, as indicated by a
40
+ copyright notice that is included in or attached to the work (an example
41
+ is provided in the Appendix below).
42
+
43
+ "**Derivative Works**" shall mean any work, whether in Source or Object
44
+ form, that is based on (or derived from) the Work and for which the
45
+ editorial revisions, annotations, elaborations, or other modifications
46
+ represent, as a whole, an original work of authorship. For the purposes
47
+ of this License, Derivative Works shall not include works that remain
48
+ separable from, or merely link (or bind by name) to the interfaces of,
49
+ the Work and Derivative Works thereof.
50
+
51
+ "**Contribution**" shall mean any work of authorship, including the
52
+ original version of the Work and any modifications or additions to that
53
+ Work or Derivative Works thereof, that is intentionally submitted to
54
+ Licensor for inclusion in the Work by the copyright owner or by an
55
+ individual or Legal Entity authorized to submit on behalf of the
56
+ copyright owner. For the purposes of this definition, "**submitted**"
57
+ means any form of electronic, verbal, or written communication sent to
58
+ the Licensor or its representatives, including but not limited to
59
+ communication on electronic mailing lists, source code control systems,
60
+ and issue tracking systems that are managed by, or on behalf of, the
61
+ Licensor for the purpose of discussing and improving the Work, but
62
+ excluding communication that is conspicuously marked or otherwise
63
+ designated in writing by the copyright owner as "**Not a
64
+ Contribution**".
65
+
66
+ "**Contributor**" shall mean Licensor and any individual or Legal Entity
67
+ on behalf of whom a Contribution has been received by Licensor and
68
+ subsequently incorporated within the Work.
69
+
70
+ ### 2. Grant of Copyright License.
71
+
72
+ Subject to the terms and conditions of this License, each Contributor
73
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
74
+ royalty-free, irrevocable copyright license to reproduce, prepare
75
+ Derivative Works of, publicly display, publicly perform, sublicense,
76
+ and distribute the Work and such Derivative Works in Source or Object
77
+ form.
78
+
79
+ ### 3. Grant of Patent License.
80
+
81
+ Subject to the terms and conditions of this License, each Contributor
82
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
83
+ royalty-free, irrevocable (except as stated in this section) patent
84
+ license to make, have made, use, offer to sell, sell, import, and
85
+ otherwise transfer the Work, where such license applies only to those
86
+ patent claims licensable by such Contributor that are necessarily
87
+ infringed by their Contribution(s) alone or by combination of their
88
+ Contribution(s) with the Work to which such Contribution(s) was
89
+ submitted. If You institute patent litigation against any entity
90
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
91
+ the Work or a Contribution incorporated within the Work constitutes
92
+ direct or contributory patent infringement, then any patent licenses
93
+ granted to You under this License for that Work shall terminate as of
94
+ the date such litigation is filed.
95
+
96
+ ### 4. Redistribution.
97
+
98
+ You may reproduce and distribute copies of the Work or Derivative Works
99
+ thereof in any medium, with or without modifications, and in Source or
100
+ Object form, provided that You meet the following conditions:
101
+
102
+ <ol type="a">
103
+ <li>You must give any other recipients of the Work or Derivative Works
104
+ a copy of this License; and
105
+ <li>You must cause any modified files to carry prominent notices
106
+ stating that You changed the files; and
107
+ <li>You must retain, in the Source form of any Derivative Works that
108
+ You distribute, all copyright, patent, trademark, and attribution
109
+ notices from the Source form of the Work, excluding those notices
110
+ that do not pertain to any part of the Derivative Works; and
111
+ <li>If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained within
114
+ such NOTICE file, excluding those notices that do not pertain to any
115
+ part of the Derivative Works, in at least one of the following
116
+ places: within a NOTICE text file distributed as part of the
117
+ Derivative Works; within the Source form or documentation, if
118
+ provided along with the Derivative Works; or, within a display
119
+ generated by the Derivative Works, if and wherever such third-party
120
+ notices normally appear. The contents of the NOTICE file are for
121
+ informational purposes only and do not modify the License. You may
122
+ add Your own attribution notices within Derivative Works that You
123
+ distribute, alongside or as an addendum to the NOTICE text from the
124
+ Work, provided that such additional attribution notices cannot be
125
+ construed as modifying the License.
126
+ </ol>
127
+
128
+ You may add Your own copyright statement to Your modifications and may
129
+ provide additional or different license terms and conditions for use,
130
+ reproduction, or distribution of Your modifications, or for any such
131
+ Derivative Works as a whole, provided Your use, reproduction, and
132
+ distribution of the Work otherwise complies with the conditions stated
133
+ in this License.
134
+
135
+ ### 5. Submission of Contributions.
136
+
137
+ Unless You explicitly state otherwise, any Contribution intentionally
138
+ submitted for inclusion in the Work by You to the Licensor shall be
139
+ under the terms and conditions of this License, without any additional
140
+ terms or conditions. Notwithstanding the above, nothing herein shall
141
+ supersede or modify the terms of any separate license agreement you may
142
+ have executed with Licensor regarding such Contributions.
143
+
144
+ ### 6. Trademarks.
145
+
146
+ This License does not grant permission to use the trade names,
147
+ trademarks, service marks, or product names of the Licensor, except as
148
+ required for reasonable and customary use in describing the origin of
149
+ the Work and reproducing the content of the NOTICE file.
150
+
151
+ ### 7. Disclaimer of Warranty.
152
+
153
+ Unless required by applicable law or agreed to in writing, Licensor
154
+ provides the Work (and each Contributor provides its Contributions) on
155
+ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
156
+ express or implied, including, without limitation, any warranties or
157
+ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
158
+ A PARTICULAR PURPOSE. You are solely responsible for determining the
159
+ appropriateness of using or redistributing the Work and assume any risks
160
+ associated with Your exercise of permissions under this License.
161
+
162
+ ### 8. Limitation of Liability.
163
+
164
+ In no event and under no legal theory, whether in tort (including
165
+ negligence), contract, or otherwise, unless required by applicable law
166
+ (such as deliberate and grossly negligent acts) or agreed to in writing,
167
+ shall any Contributor be liable to You for damages, including any
168
+ direct, indirect, special, incidental, or consequential damages of any
169
+ character arising as a result of this License or out of the use or
170
+ inability to use the Work (including but not limited to damages for loss
171
+ of goodwill, work stoppage, computer failure or malfunction, or any and
172
+ all other commercial damages or losses), even if such Contributor has
173
+ been advised of the possibility of such damages.
174
+
175
+ ### 9. Accepting Warranty or Additional Liability.
176
+
177
+ While redistributing the Work or Derivative Works thereof, You may
178
+ choose to offer, and charge a fee for, acceptance of support, warranty,
179
+ indemnity, or other liability obligations and/or rights consistent with
180
+ this License. However, in accepting such obligations, You may act only
181
+ on Your own behalf and on Your sole responsibility, not on behalf of any
182
+ other Contributor, and only if You agree to indemnify, defend, and hold
183
+ each Contributor harmless for any liability incurred by, or claims
184
+ asserted against, such Contributor by reason of your accepting any
185
+ such warranty or additional liability.
186
+
187
+ ##### END OF TERMS AND CONDITIONS
188
+
189
+ ## APPENDIX: How to apply the Apache License to your work.
190
+
191
+ To apply the Apache License to your work, attach the following
192
+ boilerplate notice, with the fields enclosed by brackets "[]"
193
+ replaced with your own identifying information. (Don't include the
194
+ brackets!) The text should be enclosed in the appropriate comment
195
+ syntax for the file format. We also recommend that a file or class name
196
+ and description of purpose be included on the same "printed page" as the
197
+ copyright notice for easier identification within third-party archives.
198
+
199
+ > #### Copyright [yyyy] [name of copyright owner]
200
+ >
201
+ > Licensed under the Apache License, Version 2.0 (the "License");
202
+ > you may not use this file except in compliance with the License.
203
+ > You may obtain a copy of the License at
204
+ >
205
+ > [http://www.apache.org/licenses/](http://www.apache.org/licenses/)
206
+ >
207
+ > Unless required by applicable law or agreed to in writing, software
208
+ > distributed under the License is distributed on an "AS IS" BASIS,
209
+ > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
210
+ > See the License for the specific language governing permissions and
211
+ > limitations under the License.
package/NOTICE.md ADDED
@@ -0,0 +1,13 @@
1
+ # Copyright 2022-2025 Juit GmbH
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ [http://www.apache.org/licenses/](http://www.apache.org/licenses/)
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ PlugJS ESLint (v9) Shared Configuration for Vue
2
+ ===============================================
3
+
4
+ This package exports simple configurations for linting our Vue projects.
5
+
6
+ Just add in your `eslint.config.mjs` something similar to:
7
+
8
+ ```javascript
9
+ // import { defineConfig } from 'eslint/config'
10
+ import configurations from '@plugjs/eslint-plugin-vue'
11
+
12
+ export default [
13
+ ...configurations,
14
+
15
+ // ===== IGNORED FILES =======================================================
16
+ // REMEMBER! Ignores *must* be in its own configuration, they can not coexist
17
+ // with "rules", "languageOptions", "files", ... or anything else, otherwise
18
+ // ESLint will blaantly ignore the ignore files!
19
+ {
20
+ name: 'local/ignores',
21
+ ignores: [
22
+ 'dist/',
23
+ 'public/',
24
+ ],
25
+ },
26
+ ]
27
+ ```
28
+
29
+
30
+ Legal Stuff
31
+ -----------
32
+
33
+ * [Copyright Notice](NOTICE.md)
34
+ * [License](LICENSE.md)
package/index.mjs ADDED
@@ -0,0 +1,74 @@
1
+ import configurations from '@plugjs/eslint-plugin'
2
+ import vuePlugin from 'eslint-plugin-vue'
3
+ import * as espree from 'espree'
4
+ import vueParser from 'vue-eslint-parser'
5
+
6
+ export default [
7
+ // ===== GENERAL JS/TS CONFIGURATIONS FROM PLUGJS AND VUE ====================
8
+
9
+ // Any config for TS also applies to VUE files
10
+ ...configurations.map((config) => {
11
+ if (config.files?.includes('**/*.ts')) config.files.push('**/*.vue')
12
+ return config
13
+ }),
14
+
15
+ // All VUE configurations are restricted to ".vue" files
16
+ ...vuePlugin.configs['flat/recommended'].map((config) => {
17
+ config.files = [ '**/*.vue' ]
18
+ return config
19
+ }),
20
+
21
+ // ===== PARSERS CONFIGURATION FOR VUE ========================================
22
+
23
+ // Set the *default* parser, for all files, to be specifically the VUE parser
24
+ // backed by TypeScript ESLint's own parser (all our .vue are in TypeScript)
25
+ {
26
+ name: 'plugjs-vue/parser-vue',
27
+ languageOptions: {
28
+ parser: vueParser,
29
+ parserOptions: {
30
+ extraFileExtensions: [ '.vue' ],
31
+ parser: '@typescript-eslint/parser',
32
+ },
33
+ },
34
+ },
35
+
36
+ // Specifically for JavaScript files, use the default "espree" parser, as
37
+ // JavaScript sources (like this file) are not present in "tsconfig.json".
38
+ {
39
+ name: 'plugjs-vue/parser-js',
40
+ files: [ '**/*.mjs', '**/*.cjs', '**/*.js' ],
41
+ languageOptions: {
42
+ parser: espree,
43
+ },
44
+ },
45
+
46
+ // ===== RULES CONFIGURATION FOR VUE =========================================
47
+
48
+ // For all files, apply some base rules: marking "@/..." imports as internal,
49
+ // and disabling the "no-floating-promises" rule as it exponentially increases
50
+ // the linting time (and in the browser, we normally have a trap globally).
51
+ {
52
+ name: 'plugjs-vue/rules-base',
53
+
54
+ settings: { 'import-x/internal-regex': /^@\/.*/ },
55
+ rules: { '@typescript-eslint/no-floating-promises': [ 'off' ] },
56
+ },
57
+
58
+ // For Vue files, apply some Vue-specific rules (we don't apply them globally
59
+ // as they are useless outside of Vue files - just a waste of time).
60
+ {
61
+ name: 'plugjs-vue/rules-vue',
62
+ files: [ '**/*.vue' ],
63
+ rules: {
64
+ // We don't care about "multiple words" in components
65
+ 'vue/multi-word-component-names': [ 'off' ],
66
+ // Either 3 attributes on a single line, or all attributes on newlines!
67
+ 'vue/max-attributes-per-line': [ 'warn', {
68
+ 'singleline': 3,
69
+ } ],
70
+ // No unused variables, ever
71
+ 'vue/no-unused-vars': 'error',
72
+ },
73
+ },
74
+ ]
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@plugjs/eslint-plugin-vue",
3
+ "version": "0.1.0",
4
+ "description": "Shared ESLint configurations and extras for Vue",
5
+ "main": "./index.mjs",
6
+ "type": "module",
7
+ "author": "Team Juit <developers@juit.com>",
8
+ "license": "Apache-2.0",
9
+ "scripts": {
10
+ "build": "eslint-check-deprecated-rules && eslint"
11
+ },
12
+ "dependencies": {
13
+ "@plugjs/eslint-plugin": "^0.5.0",
14
+ "eslint-plugin-vue": "^10.4.0",
15
+ "espree": "^10.4.0",
16
+ "vue-eslint-parser": "^10.2.0"
17
+ },
18
+ "devDependencies": {
19
+ "eslint": "^9.35.0",
20
+ "typescript": "^5.9.2"
21
+ },
22
+ "peerDependencies": {
23
+ "eslint": "^9.35.0"
24
+ },
25
+ "files": [
26
+ "*.md",
27
+ "index.mjs"
28
+ ],
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+ssh://git@github.com/plugjs/eslint-plugin-vue.git"
32
+ },
33
+ "keywords": [
34
+ "eslint",
35
+ "eslint-plugin",
36
+ "eslintplugin",
37
+ "javascript",
38
+ "typescript",
39
+ "vue",
40
+ "vue3",
41
+ "vuejs"
42
+ ],
43
+ "bugs": {
44
+ "url": "https://github.com/plugjs/eslint-plugin-vue/issues"
45
+ },
46
+ "homepage": "https://github.com/plugjs/eslint-plugin-vue#readme"
47
+ }