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

@@ -3,4 +3,4 @@
"tabWidth": 4,
"trailingComma": "all",
"useTabs": true
}
}

View File

@@ -1,54 +1,25 @@
import { defineConfig, globalIgnores } from "eslint/config";
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";
// @ts-check
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);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default defineConfig([
globalIgnores(["out"]),
export default defineConfig(
js.configs.recommended,
ts.configs.recommended,
roblox.configs.recommended,
eslintPluginPrettierRecommended,
{
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: {
"prettier/prettier": "warn",
"@typescript-eslint/no-unused-vars": ["error", {
"varsIgnorePattern": "^[A-Z].*(Service|Controller|Component)$"
}]
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^[A-Z].*(Service|Controller|Component)$",
},
],
"@typescript-eslint/no-empty-object-type": "off",
},
},
]);
);

View File

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