Skip to content

Commit f2e2dad

Browse files
committed
Add eslint config
1 parent 606e342 commit f2e2dad

24 files changed

Lines changed: 524 additions & 390 deletions

.eslintignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Modules and libraries
2+
node_modules/
3+
dist/
4+
build/
5+
6+
## Build files
7+
pnpm-lock.json
8+
9+
## Environment
10+
src/vite-env.d.ts
11+
env.d.ts
12+
13+
## Linter / Formatter
14+
.prettierrc
15+
.eslintrc
16+
.stylelintrc
17+
18+
## Config files
19+
vite.config.ts
20+
tailwind.config.cjs
21+
postcss.config.cjs
22+
23+
## Tauri
24+
src-tauri/
25+
26+
## Lua
27+
src-lua/

.eslintrc

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2022": true,
5+
"node": true
6+
},
7+
"settings": {
8+
"import/parsers": {
9+
"@typescript-eslint/parser": [".ts", ".tsx"]
10+
},
11+
"import/resolver": {
12+
"node": {
13+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
14+
},
15+
"typescript": {}
16+
},
17+
"react": {
18+
"version": "detect"
19+
}
20+
},
21+
"overrides": [
22+
{
23+
"files": ["**/*.test.ts", "**/*.test.tsx"],
24+
"env": {
25+
"jest": true
26+
}
27+
}
28+
],
29+
"parser": "@typescript-eslint/parser",
30+
"parserOptions": {
31+
"ecmaVersion": "latest",
32+
"sourceType": "module",
33+
"project": ["./tsconfig.json", "./tsconfig.node.json"],
34+
"tsconfigRootDir": "./"
35+
},
36+
"ignorePatterns": ["dist", ".eslintrc"],
37+
"plugins": [
38+
"@typescript-eslint",
39+
"react",
40+
"prettier",
41+
"tailwindcss",
42+
"react-hooks",
43+
"jsx-a11y",
44+
"promise",
45+
"import",
46+
"unicorn",
47+
"testing-library",
48+
"react-refresh"
49+
],
50+
"extends": [
51+
"eslint:recommended",
52+
"plugin:prettier/recommended",
53+
"plugin:@typescript-eslint/recommended-type-checked",
54+
"plugin:react/recommended",
55+
"plugin:react/jsx-runtime",
56+
"plugin:jsx-a11y/recommended",
57+
"plugin:unicorn/recommended",
58+
"plugin:react-hooks/recommended",
59+
"plugin:security/recommended",
60+
"plugin:promise/recommended",
61+
"plugin:import/recommended",
62+
"plugin:n/recommended",
63+
"plugin:tailwindcss/recommended",
64+
"prettier"
65+
],
66+
"rules": {
67+
"@typescript-eslint/no-unsafe-assignment": "warn",
68+
"@typescript-eslint/no-unsafe-member-access": "warn",
69+
"@typescript-eslint/no-unsafe-return": "warn",
70+
"@typescript-eslint/no-unused-vars": "off",
71+
"@typescript-eslint/no-misused-promises": [
72+
2,
73+
{
74+
"checksVoidReturn": {
75+
"attributes": false
76+
}
77+
}
78+
],
79+
"n/no-missing-import": "off",
80+
"no-unused-vars": "off",
81+
"no-unused-expressions": [
82+
"error",
83+
{
84+
"allowTernary": true
85+
}
86+
],
87+
88+
"jsx-a11y/anchor-is-valid": "warn",
89+
"prettier/prettier": "warn",
90+
"promise/catch-or-return": "error",
91+
"promise/no-new-statics": "error",
92+
"promise/no-return-wrap": "error",
93+
"promise/param-names": "error",
94+
"promise/avoid-new": "warn",
95+
"promise/no-callback-in-promise": "warn",
96+
"promise/no-nesting": "warn",
97+
"promise/no-promise-in-callback": "warn",
98+
"promise/no-return-in-finally": "warn",
99+
"promise/valid-params": "warn",
100+
"promise/always-return": "off",
101+
"promise/no-native": "off",
102+
"react/prop-types": "off",
103+
"react/react-in-jsx-scope": "off",
104+
"react-hooks/rules-of-hooks": "error",
105+
"react-hooks/exhaustive-deps": "warn",
106+
"react-refresh/only-export-components": [
107+
"warn",
108+
{ "allowConstantExport": true }
109+
],
110+
"unicorn/expiring-todo-comments": "off",
111+
"unicorn/filename-case": "off",
112+
"unicorn/no-useless-undefined": "warn",
113+
"unicorn/prevent-abbreviations": "warn"
114+
}
115+
}

.github/workflows/lint.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: 20
23-
cache: "npm"
23+
cache: 'npm'
2424

2525
- name: Install dependencies
2626
run: npm ci
@@ -48,7 +48,10 @@ jobs:
4848
sudo apt-get install -y lua5.4 luarocks
4949
5050
- name: Install luacheck
51-
run: luarocks install luacheck
51+
run: luarocks install luacheck --local
52+
53+
- name: Add local LuaRocks bin to PATH
54+
run: echo "$HOME/.luarocks/bin" >> $GITHUB_PATH
5255

5356
- name: Run luacheck with Love2D globals
54-
run: luacheck src-lua
57+
run: luacheck src-lua --globals love

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: LuaRocks release
22
on:
33
push:
44
tags: # Will upload to luarocks.org when a tag is pushed
5-
- "*"
5+
- '*'
66
pull_request: # Will test a local install without uploading to luarocks.org
77

88
jobs:
@@ -17,6 +17,7 @@ jobs:
1717
- name: LuaRocks Upload
1818
uses: nvim-neorocks/luarocks-tag-release@v7
1919
with:
20+
license: Feather License
2021
labels: |
2122
love2d
2223
löve
@@ -32,5 +33,5 @@ jobs:
3233
- name: GitHub Release
3334
uses: ncipollo/release-action@v1
3435
with:
35-
bodyFile: "CHANGELOG.md"
36+
bodyFile: 'CHANGELOG.md'
3637
allowUpdates: true

.prettierignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Modules and libraries
2+
node_modules/
3+
dist/
4+
build/
5+
6+
## Build files
7+
pnpm-lock.json
8+
9+
## Environment
10+
src/vite-env.d.ts
11+
env.d.ts
12+
13+
## Linter / Formatter
14+
.prettierrc
15+
.eslintrc
16+
.stylelintrc
17+
18+
## Config files
19+
vite.config.ts
20+
tailwind.config.js
21+
postcss.config.js
22+
23+
## Tauri
24+
src-tauri/
25+
26+
## Lua
27+
src-lua/

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"printWidth": 120,
7+
"bracketSpacing": true,
8+
"endOfLine": "lf"
9+
}

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ end
5858

5959
`Feather:init(config)` accepts the following options:
6060

61-
| Option | Type | Default | Description |
62-
|-----------------------------|-------------|----------------------|-------------|
63-
| `debug` | `boolean` | `false` | Enable or disable Feather entirely. |
64-
| `host` | `string` | `"*"` | Host address to bind the server to. |
65-
| `port` | `number` | `4004` | Port to listen on. |
66-
| `baseDir` | `string` | `""` | Base directory path for file references and deeplinking to vs code |
67-
| `wrapPrint` | `boolean` | `false` | Wrap `print()` calls to send to Feather's log viewer. |
68-
| `whitelist` | `table` | `{ "127.0.0.1" }` | List of IPs allowed to connect. |
69-
| `maxTempLogs` | `number` | `200` | Max number of temporary logs stored before rotation. |
70-
| `updateInterval` | `number` | `0.1` | Interval between sending updates to clients. |
71-
| `defaultObservers` | `boolean` | `false` | Register built-in variable watchers. |
72-
| `errorWait` | `number` | `3` | Seconds to wait for error delivery before showing LÖVE's handler. |
73-
| `autoRegisterErrorHandler` | `boolean` | `false` | Replace LÖVE's `errorhandler` to capture errors. |
74-
| `errorHandler` | `function` | `love.errorhandler` | Custom error handler to use. |
75-
| `plugins` | `table` | `{}` | List of plugin modules to load. (Support Coming soon) |
61+
| Option | Type | Default | Description |
62+
| -------------------------- | ---------- | ------------------- | ------------------------------------------------------------------ |
63+
| `debug` | `boolean` | `false` | Enable or disable Feather entirely. |
64+
| `host` | `string` | `"*"` | Host address to bind the server to. |
65+
| `port` | `number` | `4004` | Port to listen on. |
66+
| `baseDir` | `string` | `""` | Base directory path for file references and deeplinking to vs code |
67+
| `wrapPrint` | `boolean` | `false` | Wrap `print()` calls to send to Feather's log viewer. |
68+
| `whitelist` | `table` | `{ "127.0.0.1" }` | List of IPs allowed to connect. |
69+
| `maxTempLogs` | `number` | `200` | Max number of temporary logs stored before rotation. |
70+
| `updateInterval` | `number` | `0.1` | Interval between sending updates to clients. |
71+
| `defaultObservers` | `boolean` | `false` | Register built-in variable watchers. |
72+
| `errorWait` | `number` | `3` | Seconds to wait for error delivery before showing LÖVE's handler. |
73+
| `autoRegisterErrorHandler` | `boolean` | `false` | Replace LÖVE's `errorhandler` to capture errors. |
74+
| `errorHandler` | `function` | `love.errorhandler` | Custom error handler to use. |
75+
| `plugins` | `table` | `{}` | List of plugin modules to load. (Support Coming soon) |
7676

7777
---
7878

@@ -117,7 +117,6 @@ http://127.0.0.1:4004
117117

118118
## 📜 License
119119

120-
121120
Feel free to use and remix this project for personal, educational, or non-commercial fun.
122121

123122
Just don’t sell it, don’t make forks that let others sell it, and don’t use it for AI training — unless I say it’s okay.

eslint.config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
import pluginQuery from "@tanstack/eslint-plugin-query";
1+
import pluginQuery from '@tanstack/eslint-plugin-query';
22

3-
export default [
4-
...pluginQuery.configs["flat/recommended"],
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
6+
export default tseslint.config(
7+
...pluginQuery.configs['flat/recommended'],
58
// Any other config...
6-
];
9+
10+
eslint.configs.recommended,
11+
tseslint.configs.recommended,
12+
);

0 commit comments

Comments
 (0)