-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5a87f5f
Showing
63 changed files
with
1,969 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = tab | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.yml] | ||
indent_size = 2 | ||
indent_style = space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: CI | ||
on: | ||
- push | ||
jobs: | ||
check-eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run check:eslint | ||
check-knip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run check:knip | ||
check-prettier: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run check:prettier | ||
check-publint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run check:publint | ||
validate-schemas: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run turbo run start --filter=schemas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# global | ||
dist/ | ||
|
||
# per-package | ||
|
||
packages/schemas/data/*.json | ||
|
||
################################################################################ | ||
|
||
# bun | ||
node_modules/ | ||
|
||
# ide:intellij | ||
.idea | ||
|
||
# os:macOS | ||
.DS_Store | ||
|
||
# turborepo | ||
.turbo/ | ||
|
||
# typescript | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"EditorConfig.EditorConfig", | ||
"esbenp.prettier-vscode", | ||
"Vercel.turbo-vsc" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "always" | ||
}, | ||
"editor.formatOnSave": true, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"json", | ||
"jsonc", | ||
"typescript", | ||
"typescriptreact" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# The MIT License (MIT) | ||
|
||
Copyright (c) `2024` Florian Wendelborn | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Skyblock Finance Opensource | ||
|
||
This repo contains the opensource parts of <https://skyblock.finance> | ||
|
||
## Contributing | ||
|
||
1. Install [`bun`](https://bun.sh) | ||
2. `bun install` | ||
3. `bun run test` | ||
4. Make your changes and submit a pull request |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import tseslint from 'typescript-eslint' | ||
import eslintConfig from '@skyblock-finance/eslint-config' | ||
import { fileURLToPath } from 'node:url' | ||
import path from 'node:path' | ||
|
||
const root = (() => { | ||
const cause = [] | ||
|
||
try { | ||
// eslint-disable-next-line no-undef | ||
const result = __dirname | ||
if (result) return result | ||
} catch (error) { | ||
cause.push(error) | ||
} | ||
|
||
try { | ||
const result = import.meta.dirname | ||
if (result) return result | ||
} catch (error) { | ||
cause.push(error) | ||
} | ||
|
||
try { | ||
const result = path.dirname(fileURLToPath(import.meta.url)) | ||
if (result) return result | ||
} catch (error) { | ||
cause.push(error) | ||
} | ||
|
||
throw new Error('could not determine project root', { cause }) | ||
})() | ||
|
||
export default tseslint.config( | ||
/** | ||
* DO NOT ADD ANY OTHER KEYS TO THIS FIRST OBJECT | ||
* | ||
* @see {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files} | ||
*/ | ||
{ | ||
ignores: ['**/dist/**', '**/.turbo/**', 'packages/schemas/data/*.json'], | ||
}, | ||
{ | ||
extends: [...eslintConfig.configs.default], | ||
languageOptions: { | ||
parserOptions: { | ||
project: ['./tsconfig.json', './packages/*/tsconfig.json'], | ||
tsconfigRootDir: root, | ||
}, | ||
}, | ||
}, | ||
...eslintConfig.configs.json, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"bugs": { | ||
"url": "https://github.com/skyblock-finance/skyblock-finance-opensource/issues" | ||
}, | ||
"dependencies": { | ||
"@eslint/js": "^9.0.0", | ||
"eslint-plugin-jsonc": "^2.15.0", | ||
"jsonc-eslint-parser": "^2.4.0", | ||
"typescript-eslint": "^7.6.0" | ||
}, | ||
"description": "Skyblock Finance Shared ESLint Config", | ||
"devDependencies": { | ||
"@types/eslint__js": "^8.42.3", | ||
"@typescript-eslint/utils": "^7.6.0" | ||
}, | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
} | ||
}, | ||
"files": [ | ||
"dist/**/!(*.tsbuildinfo)" | ||
], | ||
"homepage": "https://github.com/skyblock-finance/skyblock-finance-opensource/tree/master/packages/eslint-config", | ||
"keywords": [ | ||
"eslint", | ||
"eslint-config" | ||
], | ||
"license": "MIT", | ||
"module": "./dist/index.js", | ||
"name": "@skyblock-finance/eslint-config", | ||
"peerDependencies": { | ||
"eslint": ">= 9", | ||
"typescript": ">= 4" | ||
}, | ||
"repository": "git+https://github.com/skyblock-finance/skyblock-finance-opensource.git", | ||
"scripts": { | ||
"build": "tsc --build", | ||
"check:eslint": "bun run eslint --max-warnings=0 .", | ||
"check:prettier": "bun --bun run --cwd ../.. prettier --check internals/eslint-config", | ||
"check:publint": "bun --bun run publint", | ||
"fix:eslint": "bun run check:eslint -- --fix", | ||
"fix:prettier": "bun --bun run check:prettier -- --write" | ||
}, | ||
"type": "module", | ||
"types": "./dist/index.d.ts", | ||
"version": "0.0.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import eslint from '@eslint/js' | ||
import tseslint from 'typescript-eslint' | ||
import jsonc from 'eslint-plugin-jsonc' | ||
import jsoncEslintParser from 'jsonc-eslint-parser' | ||
import { TSESLint } from '@typescript-eslint/utils' | ||
|
||
export default { | ||
configs: { | ||
default: tseslint.config({ | ||
extends: [ | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommendedTypeChecked, | ||
...tseslint.configs.stylisticTypeChecked, | ||
], | ||
ignores: ['**/*.json'], | ||
languageOptions: { | ||
parser: tseslint.parser, | ||
}, | ||
linterOptions: { | ||
reportUnusedDisableDirectives: 'error', | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
args: 'all', | ||
argsIgnorePattern: '^_', | ||
caughtErrors: 'all', | ||
caughtErrorsIgnorePattern: '^_', | ||
destructuredArrayIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}), | ||
json: tseslint.config( | ||
{ | ||
files: ['**/*.json'], | ||
ignores: ['**/tsconfig*.json'], | ||
languageOptions: { | ||
parser: jsoncEslintParser, | ||
}, | ||
plugins: { | ||
jsonc, | ||
}, | ||
rules: { | ||
...(jsonc.configs['recommended-with-json'] | ||
.rules as TSESLint.FlatConfig.Rules), | ||
'jsonc/sort-keys': [ | ||
'warn', | ||
{ | ||
pathPattern: '^exports(?:\\[[^\\]]+\\]|\\.[^.]+)+$', | ||
order: ['types', 'default', 'import', 'require'], | ||
}, | ||
{ | ||
pathPattern: '.*', | ||
order: { type: 'asc' }, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['**/tsconfig*.json'], | ||
languageOptions: { | ||
parser: jsoncEslintParser, | ||
}, | ||
plugins: { | ||
jsonc, | ||
}, | ||
rules: { | ||
...(jsonc.configs['recommended-with-jsonc'] | ||
.rules as TSESLint.FlatConfig.Rules), | ||
'jsonc/sort-keys': [ | ||
'warn', | ||
{ | ||
pathPattern: '.*', | ||
order: { type: 'asc' }, | ||
}, | ||
], | ||
}, | ||
}, | ||
), | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"declaration": true, | ||
"esModuleInterop": true, | ||
"experimentalDecorators": true, | ||
"lib": ["ES2022"], | ||
"module": "ESNext", | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"noUncheckedIndexedAccess": true, | ||
"outDir": "dist", | ||
"resolveJsonModule": true, | ||
"rootDir": "source", | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "ESNext", | ||
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo" | ||
}, | ||
"exclude": ["node_modules", "dist"], | ||
"include": ["source/*.ts", "source/**/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"extends": ["//"], | ||
"pipeline": { | ||
"build": { | ||
"inputs": ["./scripts/**", "./source/**", "tsconfig.*"], | ||
"outputMode": "new-only", | ||
"outputs": ["./dist/**"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "fake-root", | ||
"private": true, | ||
"scripts": { | ||
"check:eslint": "bun run --cwd ../.. eslint --max-warnings=0 --ignore-pattern=packages --ignore-pattern=internals .", | ||
"check:knip": "bun run --cwd ../.. knip", | ||
"check:prettier": "bun --bun run --cwd ../.. prettier --check .", | ||
"fix:eslint": "yarn run check:eslint --fix", | ||
"fix:prettier": "bun --bun run check:prettier --write" | ||
}, | ||
"version": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Fake Root | ||
|
||
This package exists in order to lint the repo root with the same turborepo workflows we can use for ordinary packages. | ||
|
||
See https://turbo.build/messages/missing-root-task-in-turbo-json for context as to why this causes an infinite loop without this “root” package. |
Oops, something went wrong.