@jubstaa/config 0.0.0-stage → 1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 İlker Balcılar
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 CHANGED
@@ -1,3 +1,140 @@
1
- # Temporary Holding Version
1
+ # configs
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared ESLint, TypeScript, Prettier and Renovate configuration for the
4
+ repositories in this account.
5
+
6
+ Before this existed, ten repositories carried ten copies of the same settings
7
+ and had drifted apart: four Next.js apps agreed on only a fifth to a third of
8
+ their ESLint rules, Prettier was spelled three different ways across three
9
+ different file names, and one project had ended up on the opposite formatting
10
+ style — semicolons on, two-space indent — from every other. The settings here
11
+ are the ones most of those repositories already agreed on, raised to the
12
+ strictest version any of them had reached.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ bun add -D github:Jubstaaa/configs
18
+ ```
19
+
20
+ ## Use
21
+
22
+ ### ESLint
23
+
24
+ Pick the preset that matches the project and pass it the directory holding
25
+ `tsconfig.json`, which the type-aware rules need:
26
+
27
+ ```js
28
+ // eslint.config.mjs
29
+ import next from '@jubstaa/config/eslint/next'
30
+
31
+ export default next({ tsconfigRootDir: import.meta.dirname })
32
+ ```
33
+
34
+ `next` for a Next.js app, `node` for a server or CLI, `library` for a published
35
+ package, `base` for anything else. Each returns a flat config array, so project
36
+ rules go after it:
37
+
38
+ ```js
39
+ export default [
40
+ ...next({ tsconfigRootDir: import.meta.dirname }),
41
+ { rules: { 'no-console': 'off' } },
42
+ ]
43
+ ```
44
+
45
+ Pass `internalPattern` when the project's path alias is not `@/`:
46
+
47
+ ```js
48
+ next({
49
+ internalPattern: ['^@/', '^#site/'],
50
+ tsconfigRootDir: import.meta.dirname,
51
+ })
52
+ ```
53
+
54
+ ### TypeScript
55
+
56
+ ```json
57
+ {
58
+ "extends": "@jubstaa/config/tsconfig/next",
59
+ "compilerOptions": { "paths": { "@/*": ["./src/*"] } },
60
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
61
+ }
62
+ ```
63
+
64
+ `paths`, `include` and `exclude` stay in the project: they describe its layout,
65
+ not its standards.
66
+
67
+ ### Prettier
68
+
69
+ ```json
70
+ { "prettier": "@jubstaa/config/prettier" }
71
+ ```
72
+
73
+ ### Renovate
74
+
75
+ ```json
76
+ { "extends": ["github>Jubstaaa/configs"] }
77
+ ```
78
+
79
+ One line per repository, and the dependency policy lives in one place. Dependabot
80
+ has no equivalent — its configuration cannot be shared — which is the reason to
81
+ move.
82
+
83
+ ## What the presets decide
84
+
85
+ **Type-aware linting everywhere.** `strictTypeChecked` and
86
+ `stylisticTypeChecked` from typescript-eslint, not the plain `recommended`
87
+ preset. These catch floating promises, unsafe `any` flow and misused
88
+ `await` — the bugs that type checking alone does not.
89
+
90
+ **Imports are sorted and type-only imports are marked.** Perfectionist sorts
91
+ them naturally; `consistent-type-imports` writes them inline. That combination
92
+ is what `verbatimModuleSyntax` needs to erase types correctly.
93
+
94
+ **Unused code is an error, with `_` as the escape hatch.** A leading underscore
95
+ on a variable, argument or caught error silences it, so a deliberate placeholder
96
+ reads differently from an oversight.
97
+
98
+ **No comments.** `eslint-plugin-no-comments` rejects comment blocks. Directives
99
+ still pass — `@ts-expect-error`, `eslint-disable`, `prettier-ignore`, `v8
100
+ ignore` — because those are instructions to tooling, not prose. The reasoning
101
+ that would have gone in a comment goes in the commit message, the pull request,
102
+ or a file like this one.
103
+
104
+ **`console` is limited to `error` and `warn`,** which are the levels that go to
105
+ server logs. Scripts and config files are exempt, since reporting to a terminal
106
+ is their job.
107
+
108
+ **Tests relax two rules.** Asymmetric matchers (`expect.any`,
109
+ `expect.stringContaining`) are typed `any` by every test runner, so
110
+ `no-unsafe-argument` and `no-unsafe-assignment` would fire on correct code.
111
+
112
+ **Prettier goes last** and turns off every rule it owns, so formatting is
113
+ settled in one place.
114
+
115
+ ## What the TypeScript bases decide
116
+
117
+ Beyond `strict`, all four turn on the checks that catch real bugs rather than
118
+ style: `noUncheckedIndexedAccess` (an array lookup can miss),
119
+ `exactOptionalPropertyTypes` (absent is not the same as `undefined`),
120
+ `noImplicitOverride`, `noImplicitReturns` and `noFallthroughCasesInSwitch`.
121
+
122
+ `noUnusedLocals` and `noUnusedParameters` are deliberately left off: ESLint's
123
+ `no-unused-vars` already covers them, reports them as you type, and understands
124
+ the `_` prefix.
125
+
126
+ `verbatimModuleSyntax` is on, so a type import that is not marked as one is an
127
+ error rather than a runtime import of nothing.
128
+
129
+ ## Formatting
130
+
131
+ Four spaces, no semicolons, single quotes, `es5` trailing commas, arrow
132
+ parentheses omitted where possible, and the closing bracket on the same line.
133
+ Prettier's default print width is kept, which is why no `printWidth` appears.
134
+
135
+ `.editorconfig` is not installable from a package; copy the one at the root of
136
+ this repository into a project that needs it.
137
+
138
+ ## License
139
+
140
+ MIT
package/default.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended",
5
+ ":semanticCommits",
6
+ ":semanticCommitTypeAll(chore)"
7
+ ],
8
+ "schedule": ["* 0-6 * * 1"],
9
+ "timezone": "Europe/Istanbul",
10
+ "labels": ["dependencies"],
11
+ "platformAutomerge": true,
12
+ "packageRules": [
13
+ {
14
+ "matchUpdateTypes": ["minor", "patch"],
15
+ "matchCurrentVersion": "!/^0/",
16
+ "automerge": true,
17
+ "groupName": "non-major dependencies"
18
+ },
19
+ {
20
+ "matchUpdateTypes": ["patch"],
21
+ "matchCurrentVersion": "/^0/",
22
+ "automerge": true,
23
+ "groupName": "non-major dependencies"
24
+ },
25
+ {
26
+ "matchManagers": ["github-actions"],
27
+ "groupName": "github actions",
28
+ "automerge": false
29
+ },
30
+ {
31
+ "matchManagers": ["dockerfile", "docker-compose"],
32
+ "matchUpdateTypes": ["patch", "digest"],
33
+ "groupName": "container images",
34
+ "automerge": true
35
+ },
36
+ {
37
+ "matchManagers": ["dockerfile", "docker-compose"],
38
+ "matchUpdateTypes": ["major", "minor"],
39
+ "groupName": "container images",
40
+ "automerge": false
41
+ },
42
+ {
43
+ "matchPackageNames": ["/^@tauri-apps//", "/^tauri/"],
44
+ "groupName": "tauri"
45
+ }
46
+ ],
47
+ "lockFileMaintenance": {
48
+ "enabled": true,
49
+ "automerge": true
50
+ },
51
+ "vulnerabilityAlerts": {
52
+ "labels": ["security"],
53
+ "schedule": ["at any time"],
54
+ "automerge": true
55
+ },
56
+ "dependencyDashboard": false
57
+ }
package/eslint/base.js ADDED
@@ -0,0 +1,127 @@
1
+ import { includeIgnoreFile } from '@eslint/compat'
2
+ import prettier from 'eslint-config-prettier/flat'
3
+ import noComments from 'eslint-plugin-no-comments'
4
+ import perfectionist from 'eslint-plugin-perfectionist'
5
+ import { defineConfig } from 'eslint/config'
6
+ import { existsSync } from 'node:fs'
7
+ import { join } from 'node:path'
8
+ import tseslint from 'typescript-eslint'
9
+
10
+ export function base({ internalPattern = ['^@/'], tsconfigRootDir } = {}) {
11
+ return defineConfig([
12
+ ...gitignore(tsconfigRootDir),
13
+ {
14
+ extends: [
15
+ tseslint.configs.strictTypeChecked,
16
+ tseslint.configs.stylisticTypeChecked,
17
+ ],
18
+ files: ['**/*.{ts,tsx,mts,cts}'],
19
+ languageOptions: {
20
+ parserOptions: { projectService: true, tsconfigRootDir },
21
+ },
22
+ rules: {
23
+ '@typescript-eslint/consistent-type-imports': [
24
+ 'error',
25
+ { fixStyle: 'inline-type-imports' },
26
+ ],
27
+ '@typescript-eslint/no-empty-function': [
28
+ 'error',
29
+ { allow: ['arrowFunctions'] },
30
+ ],
31
+ '@typescript-eslint/no-import-type-side-effects': 'error',
32
+ '@typescript-eslint/no-unused-vars': [
33
+ 'error',
34
+ {
35
+ argsIgnorePattern: '^_',
36
+ caughtErrorsIgnorePattern: '^_',
37
+ varsIgnorePattern: '^_',
38
+ },
39
+ ],
40
+ '@typescript-eslint/prefer-nullish-coalescing': [
41
+ 'error',
42
+ { ignorePrimitives: { string: true } },
43
+ ],
44
+ '@typescript-eslint/restrict-template-expressions': [
45
+ 'error',
46
+ { allowNumber: true },
47
+ ],
48
+ },
49
+ },
50
+
51
+ perfectionist.configs['recommended-natural'],
52
+ {
53
+ rules: {
54
+ 'perfectionist/sort-imports': [
55
+ 'error',
56
+ { internalPattern, type: 'natural' },
57
+ ],
58
+ },
59
+ },
60
+
61
+ {
62
+ plugins: { 'no-comments': noComments },
63
+ rules: {
64
+ 'no-comments/disallowComments': [
65
+ 'error',
66
+ {
67
+ allow: [
68
+ '/(usr|bin)/',
69
+ '#__PURE__',
70
+ '/ <reference',
71
+ '@jsx',
72
+ '@license',
73
+ '@preserve',
74
+ '@ts-',
75
+ '@vitest-environment',
76
+ 'biome-ignore',
77
+ 'c8 ignore',
78
+ 'eslint',
79
+ 'global',
80
+ 'istanbul ',
81
+ 'prettier-ignore',
82
+ 'v8 ignore',
83
+ ],
84
+ },
85
+ ],
86
+ 'no-console': ['error', { allow: ['error', 'warn'] }],
87
+ },
88
+ },
89
+
90
+ {
91
+ files: [
92
+ '**/*.test.{ts,tsx}',
93
+ '**/*.spec.{ts,tsx}',
94
+ 'e2e/**',
95
+ 'test/**',
96
+ 'tests/**',
97
+ ],
98
+ rules: {
99
+ '@typescript-eslint/await-thenable': 'off',
100
+ '@typescript-eslint/no-confusing-void-expression': 'off',
101
+ '@typescript-eslint/no-empty-function': 'off',
102
+ '@typescript-eslint/no-non-null-assertion': 'off',
103
+ '@typescript-eslint/no-unsafe-argument': 'off',
104
+ '@typescript-eslint/no-unsafe-assignment': 'off',
105
+ '@typescript-eslint/no-unsafe-class-instance-assignment': 'off',
106
+ '@typescript-eslint/no-unsafe-enum-assignment': 'off',
107
+ '@typescript-eslint/require-await': 'off',
108
+ '@typescript-eslint/unbound-method': 'off',
109
+ 'no-console': 'off',
110
+ },
111
+ },
112
+ {
113
+ files: ['scripts/**', '**/*.config.{ts,mts,js,mjs}'],
114
+ rules: { 'no-console': 'off' },
115
+ },
116
+
117
+ prettier,
118
+ ])
119
+ }
120
+
121
+ function gitignore(root) {
122
+ if (!root) return []
123
+ const file = join(root, '.gitignore')
124
+ return existsSync(file) ? [includeIgnoreFile(file)] : []
125
+ }
126
+
127
+ export default base
@@ -0,0 +1,18 @@
1
+ import { defineConfig, globalIgnores } from 'eslint/config'
2
+
3
+ import { base } from './base.js'
4
+
5
+ export function library({ internalPattern = ['^@/'], tsconfigRootDir } = {}) {
6
+ return defineConfig([
7
+ globalIgnores(['dist/**', 'lib/**', 'coverage/**', '*.d.ts']),
8
+ ...base({ internalPattern, tsconfigRootDir }),
9
+ {
10
+ files: ['src/**/*.{ts,tsx}'],
11
+ rules: {
12
+ '@typescript-eslint/explicit-module-boundary-types': 'error',
13
+ },
14
+ },
15
+ ])
16
+ }
17
+
18
+ export default library
package/eslint/next.js ADDED
@@ -0,0 +1,42 @@
1
+ import nextVitals from 'eslint-config-next/core-web-vitals'
2
+ import nextTs from 'eslint-config-next/typescript'
3
+ import { defineConfig, globalIgnores } from 'eslint/config'
4
+
5
+ import { base } from './base.js'
6
+
7
+ export function next({ internalPattern = ['^@/'], tsconfigRootDir } = {}) {
8
+ return defineConfig([
9
+ globalIgnores([
10
+ '.next/**',
11
+ '.velite/**',
12
+ 'out/**',
13
+ 'build/**',
14
+ 'next-env.d.ts',
15
+ ]),
16
+ ...nextVitals,
17
+ ...nextTs,
18
+ ...a11yBlock(),
19
+ ...base({ internalPattern, tsconfigRootDir }),
20
+ {
21
+ files: ['next.config.{ts,mts,js,mjs}'],
22
+ rules: { '@typescript-eslint/require-await': 'off' },
23
+ },
24
+ ])
25
+ }
26
+
27
+ function a11yBlock() {
28
+ const registered = [...nextVitals, ...nextTs].find(
29
+ entry => entry.plugins?.['jsx-a11y']
30
+ )?.plugins['jsx-a11y']
31
+
32
+ if (!registered?.configs?.recommended?.rules) return []
33
+
34
+ return [
35
+ {
36
+ files: ['**/*.{jsx,tsx}'],
37
+ rules: registered.configs.recommended.rules,
38
+ },
39
+ ]
40
+ }
41
+
42
+ export default next
package/eslint/node.js ADDED
@@ -0,0 +1,12 @@
1
+ import { defineConfig, globalIgnores } from 'eslint/config'
2
+
3
+ import { base } from './base.js'
4
+
5
+ export function node({ internalPattern = ['^@/'], tsconfigRootDir } = {}) {
6
+ return defineConfig([
7
+ globalIgnores(['dist/**', 'build/**', 'coverage/**']),
8
+ ...base({ internalPattern, tsconfigRootDir }),
9
+ ])
10
+ }
11
+
12
+ export default node
@@ -0,0 +1,22 @@
1
+ import jsxA11y from 'eslint-plugin-jsx-a11y'
2
+ import reactHooks from 'eslint-plugin-react-hooks'
3
+ import reactRefresh from 'eslint-plugin-react-refresh'
4
+ import { defineConfig, globalIgnores } from 'eslint/config'
5
+
6
+ import { base } from './base.js'
7
+
8
+ export function react({
9
+ internalPattern = ['^@/'],
10
+ refresh = 'vite',
11
+ tsconfigRootDir,
12
+ } = {}) {
13
+ return defineConfig([
14
+ globalIgnores(['dist/**', 'build/**', 'coverage/**']),
15
+ reactHooks.configs.flat.recommended,
16
+ reactRefresh.configs[refresh],
17
+ jsxA11y.flatConfigs.recommended,
18
+ ...base({ internalPattern, tsconfigRootDir }),
19
+ ])
20
+ }
21
+
22
+ export default react
package/package.json CHANGED
@@ -1,6 +1,79 @@
1
1
  {
2
- "name": "@jubstaa/config",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@jubstaa/config",
3
+ "version": "1.1.0",
4
+ "description": "Shared ESLint, TypeScript, Prettier and Renovate configuration",
5
+ "license": "MIT",
6
+ "author": "İlker Balcılar",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Jubstaaa/configs.git"
10
+ },
11
+ "type": "module",
12
+ "exports": {
13
+ "./eslint/base": "./eslint/base.js",
14
+ "./eslint/library": "./eslint/library.js",
15
+ "./eslint/next": "./eslint/next.js",
16
+ "./eslint/node": "./eslint/node.js",
17
+ "./eslint/react": "./eslint/react.js",
18
+ "./prettier": "./prettier/index.js",
19
+ "./tsconfig/base": "./typescript/base.json",
20
+ "./tsconfig/library": "./typescript/library.json",
21
+ "./tsconfig/next": "./typescript/next.json",
22
+ "./tsconfig/node": "./typescript/node.json"
23
+ },
24
+ "files": [
25
+ "eslint",
26
+ "typescript",
27
+ "prettier",
28
+ "default.json"
29
+ ],
30
+ "peerDependencies": {
31
+ "eslint": "^9.0.0 || ^10.0.0",
32
+ "eslint-config-next": ">=15",
33
+ "eslint-plugin-react-hooks": "^5.0.0 || ^6.0.0 || ^7.0.0",
34
+ "eslint-plugin-react-refresh": "^0.4.0 || ^0.5.0",
35
+ "prettier": "^3.0.0",
36
+ "typescript": "^5.0.0 || ^6.0.0"
37
+ },
38
+ "dependencies": {
39
+ "@eslint/compat": "^2.1.1",
40
+ "eslint-config-prettier": "^10.1.9",
41
+ "eslint-plugin-no-comments": "^1.2.1",
42
+ "eslint-plugin-perfectionist": "^5.14.0",
43
+ "typescript-eslint": "^8.74.0"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "eslint-config-next": {
47
+ "optional": true
48
+ },
49
+ "eslint-plugin-react-hooks": {
50
+ "optional": true
51
+ },
52
+ "eslint-plugin-react-refresh": {
53
+ "optional": true
54
+ }
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "keywords": [
60
+ "eslint-config",
61
+ "prettier-config",
62
+ "tsconfig",
63
+ "renovate-config"
64
+ ],
65
+ "bugs": {
66
+ "url": "https://github.com/Jubstaaa/configs/issues"
67
+ },
68
+ "homepage": "https://github.com/Jubstaaa/configs#readme",
69
+ "devDependencies": {
70
+ "@types/node": "^26.6.11",
71
+ "eslint": "^10.15.0",
72
+ "eslint-config-next": "^16.4.6",
73
+ "eslint-plugin-react-hooks": "^7.1.1",
74
+ "eslint-plugin-react-refresh": "^0.5.8",
75
+ "next": "16.4.6",
76
+ "prettier": "^3.10.1",
77
+ "typescript": "^5.9.3"
78
+ }
79
+ }
@@ -0,0 +1,11 @@
1
+ export default {
2
+ arrowParens: 'avoid',
3
+ bracketSameLine: true,
4
+ bracketSpacing: true,
5
+ quoteProps: 'consistent',
6
+ semi: false,
7
+ singleQuote: true,
8
+ tabWidth: 4,
9
+ trailingComma: 'es5',
10
+ useTabs: false,
11
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "allowJs": true,
5
+ "esModuleInterop": true,
6
+ "exactOptionalPropertyTypes": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "isolatedModules": true,
9
+ "module": "esnext",
10
+ "moduleResolution": "bundler",
11
+ "noFallthroughCasesInSwitch": true,
12
+ "noImplicitOverride": true,
13
+ "noImplicitReturns": true,
14
+ "noUncheckedIndexedAccess": true,
15
+ "resolveJsonModule": true,
16
+ "skipLibCheck": true,
17
+ "strict": true,
18
+ "target": "ES2022",
19
+ "verbatimModuleSyntax": true
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "lib": ["esnext"],
8
+ "outDir": "dist",
9
+ "sourceMap": true
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "incremental": true,
6
+ "jsx": "preserve",
7
+ "lib": ["dom", "dom.iterable", "esnext"],
8
+ "noEmit": true,
9
+ "plugins": [{ "name": "next" }]
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "lib": ["esnext"],
6
+ "noEmit": true
7
+ }
8
+ }