@dimensional-innovations/tool-config 3.1.0 → 5.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 +1 -1
- package/README.md +7 -120
- package/package.json +21 -14
- package/bin/lib/ci-setup.js +0 -142
- package/bin/lib/formatting.js +0 -103
- package/bin/lib/handlers/eslint.js +0 -61
- package/bin/lib/handlers/prettier.js +0 -83
- package/bin/lib/handlers/semantic-release.js +0 -60
- package/bin/lib/handlers/stylelint.js +0 -85
- package/bin/lib/handlers/typescript.js +0 -156
- package/bin/lib/package-manager.js +0 -201
- package/bin/lib/ui.js +0 -239
- package/bin/lib/uninstall.js +0 -199
- package/bin/lib/validators.js +0 -28
- package/bin/setup-tool-config.js +0 -442
- package/src/detectors.js +0 -286
- package/src/index.js +0 -69
- package/src/tools/eslint/index.js +0 -282
- package/src/tools/eslint/presets/base.js +0 -82
- package/src/tools/eslint/presets/environments/browser.js +0 -16
- package/src/tools/eslint/presets/environments/node.js +0 -21
- package/src/tools/eslint/presets/environments/universal.js +0 -18
- package/src/tools/eslint/presets/frameworks/angular.js +0 -74
- package/src/tools/eslint/presets/frameworks/astro.js +0 -38
- package/src/tools/eslint/presets/frameworks/node.js +0 -57
- package/src/tools/eslint/presets/frameworks/react.js +0 -76
- package/src/tools/eslint/presets/frameworks/solid.js +0 -45
- package/src/tools/eslint/presets/frameworks/svelte.js +0 -78
- package/src/tools/eslint/presets/frameworks/vanilla.js +0 -16
- package/src/tools/eslint/presets/frameworks/vue.js +0 -154
- package/src/tools/eslint/presets/imports.js +0 -47
- package/src/tools/eslint/presets/typescript.js +0 -142
- package/src/tools/prettier/README.md +0 -398
- package/src/tools/prettier/index.js +0 -132
- package/src/tools/prettier/presets/base.js +0 -36
- package/src/tools/prettier/presets/frameworks/astro.js +0 -15
- package/src/tools/prettier/presets/frameworks/react.js +0 -15
- package/src/tools/prettier/presets/frameworks/svelte.js +0 -22
- package/src/tools/prettier/presets/frameworks/vanilla.js +0 -13
- package/src/tools/prettier/presets/frameworks/vue.js +0 -21
- package/src/tools/prettier/presets/prettierignore.js +0 -56
- package/src/tools/semantic-release/CI_SETUP.md +0 -66
- package/src/tools/semantic-release/README.md +0 -533
- package/src/tools/semantic-release/index.js +0 -130
- package/src/tools/semantic-release/presets/default.js +0 -37
- package/src/tools/semantic-release/presets/library.js +0 -58
- package/src/tools/semantic-release/presets/monorepo.js +0 -48
- package/src/tools/semantic-release/templates/.gitlab-ci.yml +0 -89
- package/src/tools/semantic-release/templates/bitbucket-pipelines.yml +0 -100
- package/src/tools/semantic-release/templates/github-workflow.yml +0 -107
- package/src/tools/stylelint/README.md +0 -425
- package/src/tools/stylelint/index.js +0 -195
- package/src/tools/stylelint/presets/base.js +0 -50
- package/src/tools/stylelint/presets/css-modules.js +0 -43
- package/src/tools/stylelint/presets/frameworks/react.js +0 -18
- package/src/tools/stylelint/presets/frameworks/svelte.js +0 -28
- package/src/tools/stylelint/presets/frameworks/vanilla.js +0 -14
- package/src/tools/stylelint/presets/frameworks/vue.js +0 -38
- package/src/tools/stylelint/presets/scss.js +0 -83
- package/src/tools/stylelint/presets/tailwind.js +0 -49
- package/src/tools/typescript/README.md +0 -665
- package/src/tools/typescript/checker-detection.js +0 -113
- package/src/tools/typescript/index.js +0 -202
- package/src/tools/typescript/presets/base.js +0 -58
- package/src/tools/typescript/presets/environments/browser.js +0 -10
- package/src/tools/typescript/presets/environments/node.js +0 -11
- package/src/tools/typescript/presets/environments/universal.js +0 -11
- package/src/tools/typescript/presets/frameworks/angular.js +0 -11
- package/src/tools/typescript/presets/frameworks/astro.js +0 -11
- package/src/tools/typescript/presets/frameworks/electron.js +0 -100
- package/src/tools/typescript/presets/frameworks/node.js +0 -12
- package/src/tools/typescript/presets/frameworks/react.js +0 -10
- package/src/tools/typescript/presets/frameworks/solid.js +0 -11
- package/src/tools/typescript/presets/frameworks/svelte.js +0 -10
- package/src/tools/typescript/presets/frameworks/vanilla.js +0 -9
- package/src/tools/typescript/presets/frameworks/vue.js +0 -17
- package/src/utils/ignore-patterns.js +0 -157
- package/src/utils/package-reader.js +0 -42
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import vuePlugin from 'eslint-plugin-vue'
|
|
2
|
-
import tseslint from 'typescript-eslint'
|
|
3
|
-
import vueParser from 'vue-eslint-parser'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Vue.js 3 custom rules
|
|
7
|
-
* Vue 3 best practices and conventions
|
|
8
|
-
* Documentation: https://eslint.vuejs.org/rules/
|
|
9
|
-
*/
|
|
10
|
-
const vueCustomRules = {
|
|
11
|
-
// Component naming
|
|
12
|
-
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
|
13
|
-
'vue/multi-word-component-names': 'off',
|
|
14
|
-
'vue/component-definition-name-casing': ['error', 'PascalCase'],
|
|
15
|
-
|
|
16
|
-
// Template best practices
|
|
17
|
-
'vue/html-self-closing': [
|
|
18
|
-
'error',
|
|
19
|
-
{
|
|
20
|
-
html: {
|
|
21
|
-
void: 'any',
|
|
22
|
-
normal: 'always',
|
|
23
|
-
component: 'always'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
'vue/max-attributes-per-line': [
|
|
28
|
-
'error',
|
|
29
|
-
{
|
|
30
|
-
singleline: 3,
|
|
31
|
-
multiline: 1
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
'vue/first-attribute-linebreak': [
|
|
35
|
-
'error',
|
|
36
|
-
{
|
|
37
|
-
singleline: 'ignore',
|
|
38
|
-
multiline: 'below'
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
'vue/html-closing-bracket-newline': [
|
|
42
|
-
'error',
|
|
43
|
-
{
|
|
44
|
-
singleline: 'never',
|
|
45
|
-
multiline: 'always'
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
|
|
49
|
-
// Disable formatting rules that conflict with Prettier
|
|
50
|
-
'vue/multiline-html-element-content-newline': 'off',
|
|
51
|
-
'vue/singleline-html-element-content-newline': 'off',
|
|
52
|
-
|
|
53
|
-
// Vue 3 Composition API
|
|
54
|
-
'vue/no-deprecated-v-on-native-modifier': 'error',
|
|
55
|
-
'vue/no-deprecated-slot-attribute': 'error',
|
|
56
|
-
'vue/require-explicit-emits': 'error',
|
|
57
|
-
'vue/no-setup-props-reactivity-loss': 'error',
|
|
58
|
-
'vue/component-api-style': ['error', ['script-setup']],
|
|
59
|
-
'vue/define-macros-order': [
|
|
60
|
-
'error',
|
|
61
|
-
{
|
|
62
|
-
order: ['defineProps', 'defineEmits']
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
'vue/define-emits-declaration': ['error', 'type-based'],
|
|
66
|
-
|
|
67
|
-
// Directives
|
|
68
|
-
'vue/no-v-html': 'warn',
|
|
69
|
-
'vue/v-on-event-hyphenation': ['error', 'always'],
|
|
70
|
-
'vue/v-bind-style': ['error', 'shorthand'],
|
|
71
|
-
'vue/v-on-style': ['error', 'shorthand'],
|
|
72
|
-
|
|
73
|
-
// Attributes
|
|
74
|
-
'vue/attribute-hyphenation': ['error', 'always'],
|
|
75
|
-
'vue/prop-name-casing': ['error', 'camelCase'],
|
|
76
|
-
|
|
77
|
-
// Order and organization
|
|
78
|
-
'vue/order-in-components': [
|
|
79
|
-
'error',
|
|
80
|
-
{
|
|
81
|
-
order: [
|
|
82
|
-
'el',
|
|
83
|
-
'name',
|
|
84
|
-
'parent',
|
|
85
|
-
'functional',
|
|
86
|
-
['delimiters', 'comments'],
|
|
87
|
-
['components', 'directives', 'filters'],
|
|
88
|
-
'extends',
|
|
89
|
-
'mixins',
|
|
90
|
-
'inheritAttrs',
|
|
91
|
-
'model',
|
|
92
|
-
['props', 'propsData'],
|
|
93
|
-
'data',
|
|
94
|
-
'computed',
|
|
95
|
-
'watch',
|
|
96
|
-
'LIFECYCLE_HOOKS',
|
|
97
|
-
'methods',
|
|
98
|
-
['template', 'render'],
|
|
99
|
-
'renderError'
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Vue.js 3 configuration
|
|
107
|
-
* Includes Vue plugin and Vue-specific rules
|
|
108
|
-
*/
|
|
109
|
-
export default function createVuePreset() {
|
|
110
|
-
return [
|
|
111
|
-
// Vue recommended configuration (flat config)
|
|
112
|
-
...vuePlugin.configs['flat/recommended'],
|
|
113
|
-
|
|
114
|
-
// Vue-specific custom rules
|
|
115
|
-
{
|
|
116
|
-
files: ['**/*.vue', '**/*.js', '**/*.ts', '**/*.tsx'],
|
|
117
|
-
rules: vueCustomRules
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
// Vue-specific parser configuration for TypeScript in <script> tags
|
|
121
|
-
// We must explicitly set vue-eslint-parser as the main parser, then configure
|
|
122
|
-
// it to use TypeScript parser for <script> blocks via parserOptions.parser
|
|
123
|
-
{
|
|
124
|
-
files: ['**/*.vue'],
|
|
125
|
-
languageOptions: {
|
|
126
|
-
parser: vueParser,
|
|
127
|
-
parserOptions: {
|
|
128
|
-
parser: tseslint.parser,
|
|
129
|
-
extraFileExtensions: ['.vue'],
|
|
130
|
-
ecmaVersion: 'latest',
|
|
131
|
-
sourceType: 'module'
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
// Disable TypeScript naming convention for Vue files (allows onUpdate:modelValue pattern)
|
|
137
|
-
// IMPORTANT: Must also set parser to maintain vue-eslint-parser
|
|
138
|
-
{
|
|
139
|
-
files: ['**/*.vue'],
|
|
140
|
-
languageOptions: {
|
|
141
|
-
parser: vueParser,
|
|
142
|
-
parserOptions: {
|
|
143
|
-
parser: tseslint.parser,
|
|
144
|
-
extraFileExtensions: ['.vue'],
|
|
145
|
-
ecmaVersion: 'latest',
|
|
146
|
-
sourceType: 'module'
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
rules: {
|
|
150
|
-
'@typescript-eslint/naming-convention': 'off'
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { fixupPluginRules } from '@eslint/compat'
|
|
2
|
-
import importPlugin from 'eslint-plugin-import'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Import/export rules configuration
|
|
6
|
-
* Uses @eslint/compat for flat config compatibility
|
|
7
|
-
*/
|
|
8
|
-
export default {
|
|
9
|
-
plugins: {
|
|
10
|
-
import: fixupPluginRules(importPlugin)
|
|
11
|
-
},
|
|
12
|
-
rules: {
|
|
13
|
-
// ============================================================
|
|
14
|
-
// IMPORT/MODULE RULES
|
|
15
|
-
// Module import/export best practices
|
|
16
|
-
// Documentation: https://github.com/import-js/eslint-plugin-import
|
|
17
|
-
// ============================================================
|
|
18
|
-
|
|
19
|
-
'import/order': [
|
|
20
|
-
'error',
|
|
21
|
-
{
|
|
22
|
-
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
23
|
-
'newlines-between': 'always',
|
|
24
|
-
alphabetize: {
|
|
25
|
-
order: 'asc',
|
|
26
|
-
caseInsensitive: true
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
], // Enforce consistent import order with alphabetization
|
|
30
|
-
'import/no-duplicates': [
|
|
31
|
-
'error',
|
|
32
|
-
{
|
|
33
|
-
'prefer-inline': true,
|
|
34
|
-
considerQueryString: false
|
|
35
|
-
}
|
|
36
|
-
], // Prevent duplicate imports (allows type + value imports from same module)
|
|
37
|
-
'import/no-unresolved': 'off', // TypeScript handles this better
|
|
38
|
-
'import/named': 'off', // TypeScript handles this better
|
|
39
|
-
'import/namespace': 'off', // TypeScript handles this better
|
|
40
|
-
'import/default': 'off', // TypeScript handles this better
|
|
41
|
-
'import/no-named-as-default': 'warn', // Warn on potentially confusing imports
|
|
42
|
-
'import/no-named-as-default-member': 'warn', // Warn on confusing member access
|
|
43
|
-
'import/newline-after-import': 'error', // Require blank line after imports
|
|
44
|
-
'import/no-webpack-loader-syntax': 'error', // No webpack loader syntax in imports
|
|
45
|
-
'import/first': 'error' // Imports must be at the top of the file
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript-specific rules
|
|
3
|
-
* Only included when TypeScript is detected or explicitly enabled
|
|
4
|
-
*/
|
|
5
|
-
export default {
|
|
6
|
-
rules: {
|
|
7
|
-
// ============================================================
|
|
8
|
-
// TYPESCRIPT RULES
|
|
9
|
-
// TypeScript-specific linting and type safety
|
|
10
|
-
// Documentation: https://typescript-eslint.io/rules/
|
|
11
|
-
// ============================================================
|
|
12
|
-
|
|
13
|
-
// Type safety
|
|
14
|
-
'@typescript-eslint/no-explicit-any': 'warn', // Warn on any usage (allow when necessary)
|
|
15
|
-
// Note: Type-checked rules (no-unsafe-*) require TypeScript project configuration
|
|
16
|
-
// They are disabled here but available in recommended-type-checked preset
|
|
17
|
-
|
|
18
|
-
// Type annotations
|
|
19
|
-
'@typescript-eslint/explicit-function-return-type': 'off', // Too strict - TS can infer return types
|
|
20
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off', // Too strict - TS can infer exports
|
|
21
|
-
'@typescript-eslint/typedef': [
|
|
22
|
-
'error',
|
|
23
|
-
{
|
|
24
|
-
arrayDestructuring: false,
|
|
25
|
-
arrowParameter: false,
|
|
26
|
-
memberVariableDeclaration: false,
|
|
27
|
-
objectDestructuring: false,
|
|
28
|
-
parameter: false,
|
|
29
|
-
propertyDeclaration: true, // Require type annotations on class properties
|
|
30
|
-
variableDeclaration: false,
|
|
31
|
-
variableDeclarationIgnoreFunction: true
|
|
32
|
-
}
|
|
33
|
-
], // Require type annotations in specific places
|
|
34
|
-
|
|
35
|
-
// Best practices
|
|
36
|
-
'@typescript-eslint/no-unused-vars': [
|
|
37
|
-
'error',
|
|
38
|
-
{
|
|
39
|
-
argsIgnorePattern: '^_', // Allow unused args prefixed with _
|
|
40
|
-
varsIgnorePattern: '^_' // Allow unused vars prefixed with _
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
'@typescript-eslint/prefer-for-of': 'error', // Prefer for-of over standard for loop with index
|
|
44
|
-
'@typescript-eslint/no-non-null-assertion': 'warn', // Warn on non-null assertions (! operator)
|
|
45
|
-
|
|
46
|
-
// Consistency
|
|
47
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'], // Prefer interface over type alias
|
|
48
|
-
'@typescript-eslint/consistent-type-imports': [
|
|
49
|
-
'error',
|
|
50
|
-
{
|
|
51
|
-
prefer: 'type-imports', // Use import type for type-only imports
|
|
52
|
-
disallowTypeAnnotations: false
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
|
|
56
|
-
// ============================================================
|
|
57
|
-
// NAMING CONVENTIONS
|
|
58
|
-
// Enforce consistent naming patterns across the codebase
|
|
59
|
-
// Documentation: https://typescript-eslint.io/rules/naming-convention/
|
|
60
|
-
//
|
|
61
|
-
// Patterns enforced:
|
|
62
|
-
// - camelCase: variables, functions, methods, parameters
|
|
63
|
-
// - PascalCase: classes, interfaces, types, enums
|
|
64
|
-
// - UPPER_CASE: constants and enum members
|
|
65
|
-
// - underscore prefix: private members, unused parameters
|
|
66
|
-
// ============================================================
|
|
67
|
-
|
|
68
|
-
'@typescript-eslint/naming-convention': [
|
|
69
|
-
'error',
|
|
70
|
-
// Default: camelCase for most identifiers
|
|
71
|
-
{
|
|
72
|
-
selector: 'default',
|
|
73
|
-
format: ['camelCase'],
|
|
74
|
-
leadingUnderscore: 'allow',
|
|
75
|
-
trailingUnderscore: 'forbid'
|
|
76
|
-
},
|
|
77
|
-
// Variables: camelCase or UPPER_CASE for constants
|
|
78
|
-
{
|
|
79
|
-
selector: 'variable',
|
|
80
|
-
format: ['camelCase', 'UPPER_CASE', 'PascalCase'], // PascalCase for components
|
|
81
|
-
leadingUnderscore: 'allow'
|
|
82
|
-
},
|
|
83
|
-
// Functions and methods: camelCase
|
|
84
|
-
{
|
|
85
|
-
selector: ['function', 'method'],
|
|
86
|
-
format: ['camelCase']
|
|
87
|
-
},
|
|
88
|
-
// Classes, interfaces, types, enums: PascalCase
|
|
89
|
-
{
|
|
90
|
-
selector: 'typeLike',
|
|
91
|
-
format: ['PascalCase']
|
|
92
|
-
},
|
|
93
|
-
// Type parameters: PascalCase with T prefix
|
|
94
|
-
{
|
|
95
|
-
selector: 'typeParameter',
|
|
96
|
-
format: ['PascalCase'],
|
|
97
|
-
prefix: ['T']
|
|
98
|
-
},
|
|
99
|
-
// Enum members: PascalCase or UPPER_CASE
|
|
100
|
-
{
|
|
101
|
-
selector: 'enumMember',
|
|
102
|
-
format: ['PascalCase', 'UPPER_CASE']
|
|
103
|
-
},
|
|
104
|
-
// Object properties: allow camelCase, PascalCase, or UPPER_CASE (for API responses, component props, env vars)
|
|
105
|
-
{
|
|
106
|
-
selector: 'property',
|
|
107
|
-
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
108
|
-
leadingUnderscore: 'allow',
|
|
109
|
-
filter: {
|
|
110
|
-
// Allow properties with special characters (ESLint rule names, path aliases, env vars)
|
|
111
|
-
regex: '^(@|no-|prefer-|max-|vue/|import/|spaced-|react/|[A-Z_]+).*$',
|
|
112
|
-
match: false
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
// Object literal properties: allow any format (path aliases like @renderer, @main, @preload)
|
|
116
|
-
{
|
|
117
|
-
selector: 'objectLiteralProperty',
|
|
118
|
-
format: null
|
|
119
|
-
},
|
|
120
|
-
// Imports: allow camelCase or PascalCase (Vue component imports)
|
|
121
|
-
{
|
|
122
|
-
selector: 'import',
|
|
123
|
-
format: ['camelCase', 'PascalCase'],
|
|
124
|
-
leadingUnderscore: 'allow'
|
|
125
|
-
},
|
|
126
|
-
// Private class members: require underscore prefix
|
|
127
|
-
{
|
|
128
|
-
selector: 'memberLike',
|
|
129
|
-
modifiers: ['private'],
|
|
130
|
-
format: ['camelCase'],
|
|
131
|
-
leadingUnderscore: 'require'
|
|
132
|
-
},
|
|
133
|
-
// Unused parameters: require underscore prefix
|
|
134
|
-
{
|
|
135
|
-
selector: 'parameter',
|
|
136
|
-
modifiers: ['unused'],
|
|
137
|
-
format: ['camelCase'],
|
|
138
|
-
leadingUnderscore: 'require'
|
|
139
|
-
}
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
}
|