@polariens/kitsune-lint 1.0.0-rc.3

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/package.json ADDED
@@ -0,0 +1,117 @@
1
+ {
2
+ "name": "@polariens/kitsune-lint",
3
+ "version": "1.0.0-rc.3",
4
+ "description": "Opinionated ESLint & Prettier configs for high-quality Vue, TypeScript & Vitest projects. Clean code, sharp rules.",
5
+ "keywords": [
6
+ "eslint",
7
+ "prettier",
8
+ "lint",
9
+ "config",
10
+ "vue",
11
+ "typescript",
12
+ "vitest",
13
+ "clean-code",
14
+ "pinia",
15
+ "kitsune"
16
+ ],
17
+ "homepage": "https://github.com/Merieli/kitsune-lint#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/Merieli/kitsune-lint/issues"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/Merieli/kitsune-lint.git"
24
+ },
25
+ "license": "MIT",
26
+ "author": "Polariens",
27
+ "type": "module",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./eslint/index.d.mts",
31
+ "default": "./eslint/index.mjs"
32
+ },
33
+ "./eslint": {
34
+ "types": "./eslint/index.d.mts",
35
+ "default": "./eslint/index.mjs"
36
+ },
37
+ "./eslint/base": {
38
+ "types": "./eslint/configs/base.d.mts",
39
+ "default": "./eslint/configs/base.mjs"
40
+ },
41
+ "./eslint/typescript": {
42
+ "types": "./eslint/configs/typescript.d.mts",
43
+ "default": "./eslint/configs/typescript.mjs"
44
+ },
45
+ "./eslint/security": {
46
+ "types": "./eslint/configs/security.d.mts",
47
+ "default": "./eslint/configs/security.mjs"
48
+ },
49
+ "./eslint/clean-code": {
50
+ "types": "./eslint/configs/clean-code.d.mts",
51
+ "default": "./eslint/configs/clean-code.mjs"
52
+ },
53
+ "./eslint/vue": {
54
+ "types": "./eslint/configs/vue.d.mts",
55
+ "default": "./eslint/configs/vue.mjs"
56
+ },
57
+ "./eslint/pinia": {
58
+ "types": "./eslint/configs/pinia.d.mts",
59
+ "default": "./eslint/configs/pinia.mjs"
60
+ },
61
+ "./eslint/tests": {
62
+ "types": "./eslint/configs/tests.d.mts",
63
+ "default": "./eslint/configs/tests.mjs"
64
+ },
65
+ "./eslint/vitest": {
66
+ "types": "./eslint/configs/vitest.d.mts",
67
+ "default": "./eslint/configs/vitest.mjs"
68
+ },
69
+ "./prettier": {
70
+ "types": "./prettier/index.d.mts",
71
+ "default": "./prettier/index.mjs"
72
+ }
73
+ },
74
+ "main": "index.js",
75
+ "bin": {
76
+ "kitsune-prettierignore": "bin/copy-prettierignore.mjs"
77
+ },
78
+ "directories": {
79
+ "example": "examples"
80
+ },
81
+ "files": [
82
+ "eslint",
83
+ "prettier",
84
+ "bin"
85
+ ],
86
+ "scripts": {
87
+ "test": "echo \"Error: no test specified\" && exit 1"
88
+ },
89
+ "peerDependencies": {
90
+ "@eslint/js": "^9.39.4",
91
+ "@vistest/eslint-plugin": "^1.6.14",
92
+ "eslint": ">=9.0.0",
93
+ "eslint-plugin-pinia": "^0.4.2",
94
+ "eslint-plugin-security": "^4.0.0",
95
+ "eslint-plugin-vue": "^10.8.0",
96
+ "globals": "^17.4.0",
97
+ "typescript-eslint": "^8.58.0",
98
+ "vue-eslint-parser": "^10.4.0"
99
+ },
100
+ "peerDependenciesMeta": {
101
+ "@vitest/eslint-plugin": {
102
+ "optional": true
103
+ },
104
+ "eslint-plugin-security": {
105
+ "optional": true
106
+ },
107
+ "eslint-plugin-vue": {
108
+ "optional": true
109
+ },
110
+ "vue-eslint-parser": {
111
+ "optional": true
112
+ },
113
+ "eslint-plugin-pinia": {
114
+ "optional": true
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,12 @@
1
+ # Files
2
+ *.md
3
+ .gitlab-ci*.yml
4
+ Makefile
5
+
6
+ # Folders
7
+ .husky/*
8
+ .vscode/*
9
+ infra/*
10
+ bin/*
11
+ cache/*
12
+ .vitepress/*
@@ -0,0 +1,44 @@
1
+ export interface PrettierKitsuneConfig {
2
+ /** Largura máxima da linha @default 100 */
3
+ printWidth?: number;
4
+ /** Espaços por nível de indentação @default 2 */
5
+ tabWidth?: number;
6
+ /** Usar tabs ao invés de espaços @default false */
7
+ useTabs?: boolean;
8
+ /** Adicionar ponto e vírgula no final @default true */
9
+ semi?: boolean;
10
+ /** Usar aspas simples @default true */
11
+ singleQuote?: boolean;
12
+ /** Estilo de trailing comma @default 'es5' */
13
+ trailingComma?: 'all' | 'es5' | 'none';
14
+ /** Espaços dentro de chaves de objetos @default true */
15
+ bracketSpacing?: boolean;
16
+ /** Colocar > de tags na mesma linha @default false */
17
+ bracketSameLine?: boolean;
18
+ /** Parênteses em arrow functions @default 'always' */
19
+ arrowParens?: 'always' | 'avoid';
20
+ /** Quebra de linha em prosa (markdown) @default 'never' */
21
+ proseWrap?: 'always' | 'never' | 'preserve';
22
+ /** Sensibilidade a espaços em HTML @default 'strict' */
23
+ htmlWhitespaceSensitivity?: 'css' | 'strict' | 'ignore';
24
+ /** Estilo de fim de linha @default 'lf' */
25
+ endOfLine?: 'lf' | 'crlf' | 'cr' | 'auto';
26
+ /** Aspas em propriedades de objeto @default 'as-needed' */
27
+ quoteProps?: 'as-needed' | 'consistent' | 'preserve';
28
+ /** Formatar código embutido em template literals @default 'auto' */
29
+ embeddedLanguageFormatting?: 'auto' | 'off';
30
+ /** Indentação dentro de <script> e <style> em Vue SFCs @default false */
31
+ vueIndentScriptAndStyle?: boolean;
32
+ }
33
+
34
+ export interface PrettierKitsuneExtraOptions {
35
+ /** Habilita todas as configurações do prettier para Vue @default false */
36
+ vue?: boolean;
37
+ }
38
+
39
+ export declare const prettierKitsuneConfig: PrettierKitsuneConfig;
40
+
41
+ export declare function createPrettierKitsuneConfig(
42
+ overrides?: Partial<PrettierKitsuneConfig>,
43
+ options?: PrettierKitsuneExtraOptions
44
+ ): PrettierKitsuneConfig;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @typedef {Object} PrettierKitsuneOptions
3
+ * @property {number} [printWidth=100]
4
+ * @property {number} [tabWidth=2]
5
+ * @property {boolean} [useTabs=false]
6
+ * @property {boolean} [semi=true]
7
+ * @property {boolean} [singleQuote=true]
8
+ * @property {'all' | 'es5' | 'none'} [trailingComma='es5']
9
+ * @property {boolean} [bracketSpacing=true]
10
+ * @property {boolean} [bracketSameLine=false]
11
+ * @property {'always' | 'avoid'} [arrowParens='always']
12
+ * @property {'always' | 'never' | 'preserve'} [proseWrap='never']
13
+ * @property {'css' | 'strict' | 'ignore'} [htmlWhitespaceSensitivity='strict']
14
+ * @property {'lf' | 'crlf' | 'cr' | 'auto'} [endOfLine='lf']
15
+ * @property {'as-needed' | 'consistent' | 'preserve'} [quoteProps='as-needed']
16
+ * @property {'auto' | 'off'} [embeddedLanguageFormatting='auto']
17
+ * @property {boolean} [vueIndentScriptAndStyle=false]
18
+ */
19
+
20
+ /** @type {PrettierKitsuneOptions} */
21
+ const defaults = {
22
+ printWidth: 100,
23
+ tabWidth: 2,
24
+ useTabs: false,
25
+ semi: true,
26
+ singleQuote: true,
27
+ trailingComma: 'es5',
28
+ bracketSpacing: true,
29
+ bracketSameLine: false,
30
+ arrowParens: 'always',
31
+ proseWrap: 'never',
32
+ htmlWhitespaceSensitivity: 'strict',
33
+ endOfLine: 'lf',
34
+ quoteProps: 'as-needed',
35
+ embeddedLanguageFormatting: 'auto',
36
+ };
37
+
38
+ /**
39
+ * Configuração Prettier padrão.
40
+ * Importar diretamente para usar sem modificações.
41
+ *
42
+ * @example
43
+ * // prettier.config.mjs
44
+ * import { prettierKitsuneConfig } from '@merieli/kitsune-lint/prettier';
45
+ * export default prettierKitsuneConfig;
46
+ */
47
+ export const prettierKitsuneConfig = { ...defaults };
48
+
49
+ /**
50
+ * @typedef {Object} Options
51
+ * @property {boolean} [vue=false] - Habilita configurações relacionadas ao Vue, como vueIndentScriptAndStyle
52
+ */
53
+
54
+ /**
55
+ * Factory para criar config Prettier com overrides.
56
+ *
57
+ * @example
58
+ * import { createPrettierKitsuneConfig } from '@merieli/kitsune-lint/prettier';
59
+ * export default createPrettierKitsuneConfig({ printWidth: 120 });
60
+ *
61
+ * @example
62
+ * // Com opções Vue
63
+ * import { createPrettierKitsuneConfig } from '@merieli/kitsune-lint/prettier';
64
+ * export default createPrettierKitsuneConfig({ printWidth: 120 }, { vue: true });
65
+ *
66
+ * @param {Partial<PrettierKitsuneOptions>} [overrides={}]
67
+ * @param {Options} [options]
68
+ * @returns {PrettierKitsuneOptions}
69
+ */
70
+ export function createPrettierKitsuneConfig(overrides = {}, options) {
71
+ const config = { ...defaults, ...overrides };
72
+
73
+ if (options && options.vue) {
74
+ config.vueIndentScriptAndStyle = true;
75
+ }
76
+
77
+ return config;
78
+ }