Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
Comment thread
javisperez marked this conversation as resolved.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v23.6.0
v24
53 changes: 53 additions & 0 deletions eslint.config.js
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the real change, the rest is just a precommit git hook to lint files on commit and the lint:fix of the whole project to keep the style consistent.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'

import { includeIgnoreFile } from '@eslint/config-helpers'
import js from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import globals from 'globals'
import tseslint from 'typescript-eslint'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const gitignorePath = path.resolve(__dirname, '.gitignore')

export default tseslint.config(
includeIgnoreFile(gitignorePath),
{ ignores: ['dist/', 'node_modules/'] },

js.configs.recommended,
...tseslint.configs.recommended,

{
languageOptions: {
globals: globals.node,
},
plugins: {
'@stylistic': stylistic,
'simple-import-sort': simpleImportSort,
},
rules: {
// Formatting
'@stylistic/semi': ['error', 'never'],
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'@stylistic/indent': ['error', 2],
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/operator-linebreak': ['error', 'before'],

// Linting
curly: 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-console': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'off',

// Relax some defaults
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
},
},
)
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"dev": "tsc --watch",
"test": "vitest",
"test:ui": "vitest --ui",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"prepare": "husky"
},
"keywords": [
"kitops",
Expand All @@ -40,15 +43,27 @@
"url": "https://github.com/kitops-ml/kitops-ts/issues"
},
"devDependencies": {
"@eslint/config-helpers": "^0.6.0",
"@eslint/js": "^10.0.1",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/node": "^25.0.8",
"@vitest/ui": "^4.0.17",
"eslint": "^10.3.0",
"eslint-plugin-simple-import-sort": "^13.0.0",
"globals": "^17.6.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.3",
"typescript": "^5.9.3",
"typescript-eslint": "^8.59.2",
"vitest": "^4.0.17"
},
"packageManager": "pnpm@10.30.3",
"engines": {
"node": ">=23.0.0"
},
"lint-staged": {
"src/**/*.ts": "eslint --fix"
},
"dependencies": {
"yaml": "^2.8.2"
}
Expand Down
Loading
Loading