@vue-laab/presets 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maksym Vovk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @vue-laab/presets 🧪
2
+
3
+ A strictly opinionated set of configurations for **Vue 3** and **JavaScript** projects. Designed to enforce clean code, prevent reactivity pitfalls, and maintain a unified visual style.
4
+
5
+ ## Key Features
6
+
7
+ - **Modern ESLint**: Fully compatible with ESLint 9+ Flat Config.
8
+ - **Vue 3 Optimized**: Custom rules for Composition API (reactive unwrapping, block order).
9
+ - **Strict JS**: Single quotes, no semicolons, and mandatory trailing commas.
10
+ - **Reactivity Guard**: Prevents common pitfalls like missing .value in refs.
11
+ - **Prettier Integrated**: Ready-to-use formatting that perfectly matches the linting rules.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install -D @vue-laab/presets
17
+ ```
18
+
19
+ ## Setup
20
+
21
+ - **ESLint** (eslint.config.js)
22
+
23
+ ```js
24
+ import vueLaab from '@vue-laab/presets';
25
+
26
+ export default [
27
+ ...vueLaab,
28
+ {
29
+ // Override or add project-specific rules here
30
+ },
31
+ ];
32
+ ```
33
+
34
+ - **Prettier** (prettier.config.js)
35
+
36
+ ```js
37
+ import prettierConfig from '@vue-laab/presets/prettier';
38
+
39
+ export default {
40
+ ...prettierConfig,
41
+ };
42
+ ```
package/eslint.js ADDED
@@ -0,0 +1,85 @@
1
+ import js from '@eslint/js'
2
+ import pluginVue from 'eslint-plugin-vue'
3
+ import configPrettier from 'eslint-config-prettier'
4
+ import globals from 'globals'
5
+
6
+ export default [
7
+ {
8
+ ignores: ['**/dist/**', '**/node_modules/**', '**/*.cli.js', '**/*.system.js', '**/*.ignore.js'],
9
+ },
10
+ js.configs.recommended,
11
+ ...pluginVue.configs['flat/recommended'],
12
+ {
13
+ files: ['**/*.vue', '**/*.js'],
14
+ plugins: {
15
+ vue: pluginVue,
16
+ },
17
+ linterOptions: {
18
+ reportUnusedInlineConfigs: 'error',
19
+ },
20
+ languageOptions: {
21
+ ecmaVersion: 'latest',
22
+ sourceType: 'module',
23
+ globals: {
24
+ ...globals.browser,
25
+ ...globals.node,
26
+ defineProps: 'readonly',
27
+ defineEmits: 'readonly',
28
+ defineExpose: 'readonly',
29
+ withDefaults: 'readonly',
30
+ },
31
+ },
32
+ rules: {
33
+ semi: ['error', 'never'],
34
+ quotes: [
35
+ 'error',
36
+ 'single',
37
+ {
38
+ avoidEscape: true,
39
+ allowTemplateLiterals: true,
40
+ },
41
+ ],
42
+ 'comma-dangle': [
43
+ 'error',
44
+ {
45
+ arrays: 'always-multiline',
46
+ objects: 'always-multiline',
47
+ imports: 'always-multiline',
48
+ exports: 'always-multiline',
49
+ functions: 'never',
50
+ },
51
+ ],
52
+ 'no-console': ['error', { allow: ['error', 'info', 'dir', 'warn'] }],
53
+ curly: ['error', 'all'],
54
+ 'brace-style': ['error', '1tbs', { allowSingleLine: false }],
55
+ indent: ['error', 2, { SwitchCase: 1 }],
56
+ 'vue/multi-word-component-names': 'off',
57
+ 'vue/block-order': [
58
+ 'error',
59
+ {
60
+ order: ['template', 'script', 'style'],
61
+ },
62
+ ],
63
+ 'vue/attributes-order': [
64
+ 'error',
65
+ {
66
+ order: [
67
+ 'CONDITIONALS',
68
+ 'LIST_RENDERING',
69
+ 'DEFINITION',
70
+ 'RENDER_MODIFIERS',
71
+ ['UNIQUE', 'SLOT'],
72
+ 'CONTENT',
73
+ 'TWO_WAY_BINDING',
74
+ 'OTHER_DIRECTIVES',
75
+ 'GLOBAL',
76
+ 'OTHER_ATTR',
77
+ 'EVENTS',
78
+ ],
79
+ alphabetical: false,
80
+ },
81
+ ],
82
+ },
83
+ },
84
+ configPrettier,
85
+ ]
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@vue-laab/presets",
3
+ "version": "1.0.0",
4
+ "description": "A collection of opinionated ESLint and Prettier configurations for Vue 3 development. Focused on clean code, reactivity safety, and consistent styling.",
5
+ "main": "eslint.js",
6
+ "exports": {
7
+ ".": "./eslint.js",
8
+ "./prettier": "./prettier.js"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "keywords": [
14
+ "vue",
15
+ "vue3",
16
+ "eslint-config",
17
+ "prettier-config",
18
+ "dx",
19
+ "presets"
20
+ ],
21
+ "peerDependencies": {
22
+ "eslint": ">=9.0.0",
23
+ "eslint-plugin-vue": "^9.0.0",
24
+ "@eslint/js": "^9.0.0",
25
+ "eslint-config-prettier": "^9.0.0",
26
+ "globals": "^15.0.0",
27
+ "prettier": ">=3.0.0"
28
+ },
29
+ "author": "M.Vovk",
30
+ "license": "ISC"
31
+ }
package/prettier.js ADDED
@@ -0,0 +1,14 @@
1
+ export default{
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": false,
4
+ "singleQuote": true,
5
+ "jsxSingleQuote": false,
6
+ "trailingComma": "all",
7
+ "printWidth": 100,
8
+ "tabWidth": 2,
9
+ "bracketSpacing": true,
10
+ "arrowParens": "always",
11
+ "endOfLine": "auto",
12
+ "htmlWhitespaceSensitivity": "ignore",
13
+ "vueIndentScriptAndStyle": false
14
+ }