Config prettier and eslint

This commit is contained in:
2025-12-10 21:19:37 +01:00
parent cfa902a343
commit 1562e5394d
5 changed files with 43 additions and 52 deletions

21
.gitea/workflows/lint.yml Normal file
View File

@@ -0,0 +1,21 @@
name: CI
on: [push]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10
cache: true
- name: Install node
uses: actions/setup-node@v6
with:
node-version: latest
cache: 'pnpm'
- run: pnpm prettier . --check
- run: pnpm eslint .

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
pnpm-lock.yaml

View File

@@ -1,54 +1,25 @@
import { defineConfig, globalIgnores } from "eslint/config"; // @ts-check
import typescriptEslint from "@typescript-eslint/eslint-plugin";
// import robloxTs from "eslint-plugin-roblox-ts";
import prettier from "eslint-plugin-prettier";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js"; import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc"; import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import roblox from "eslint-plugin-roblox-ts";
import { defineConfig } from "eslint/config";
import ts from "typescript-eslint";
const __filename = fileURLToPath(import.meta.url); export default defineConfig(
const __dirname = path.dirname(__filename); js.configs.recommended,
const compat = new FlatCompat({ ts.configs.recommended,
baseDirectory: __dirname, roblox.configs.recommended,
recommendedConfig: js.configs.recommended, eslintPluginPrettierRecommended,
allConfig: js.configs.all,
});
export default defineConfig([
globalIgnores(["out"]),
{ {
extends: compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:roblox-ts/recommended-legacy",
"plugin:prettier/recommended",
),
plugins: {
"@typescript-eslint": typescriptEslint,
// "roblox-ts": robloxTs,
prettier,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 2018,
sourceType: "module",
parserOptions: {
jsx: true,
useJSXTextNode: true,
project: "./tsconfig.json",
},
},
rules: { rules: {
"prettier/prettier": "warn", "prettier/prettier": "warn",
"@typescript-eslint/no-unused-vars": ["error", { "@typescript-eslint/no-unused-vars": [
"varsIgnorePattern": "^[A-Z].*(Service|Controller|Component)$" "error",
}] {
varsIgnorePattern: "^[A-Z].*(Service|Controller|Component)$",
},
],
"@typescript-eslint/no-empty-object-type": "off",
}, },
}, },
]); );

View File

@@ -14,15 +14,12 @@
"license": "ISC", "license": "ISC",
"type": "commonjs", "type": "commonjs",
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.1", "@eslint/js": "^9.39.1",
"@rbxts/compiler-types": "3.0.0-types.0", "@rbxts/compiler-types": "3.0.0-types.0",
"@rbxts/services": "^1.6.0", "@rbxts/services": "^1.6.0",
"@rbxts/signal": "^1.1.1", "@rbxts/signal": "^1.1.1",
"@rbxts/t": "^3.2.1", "@rbxts/t": "^3.2.1",
"@rbxts/types": "^1.0.896", "@rbxts/types": "^1.0.896",
"@typescript-eslint/eslint-plugin": "^8.48.1",
"@typescript-eslint/parser": "^8.48.1",
"eslint": "^9.39.1", "eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4", "eslint-plugin-prettier": "^5.5.4",
@@ -32,7 +29,8 @@
"rbxts-transformer-instances": "^1.0.1", "rbxts-transformer-instances": "^1.0.1",
"rbxts-transformer-services": "^1.1.1", "rbxts-transformer-services": "^1.1.1",
"roblox-ts": "^3.0.0", "roblox-ts": "^3.0.0",
"typescript": "~5.5.4" "typescript": "~5.5.4",
"typescript-eslint": "^8.49.0"
}, },
"dependencies": { "dependencies": {
"@flamework/components": "^1.3.2", "@flamework/components": "^1.3.2",