chore: use biome instead of eslint and prettier
This commit is contained in:
parent
548871dc29
commit
7cd2acc5dd
11 changed files with 119 additions and 1007 deletions
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"env": {
|
|
||||||
"es2021": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": "latest",
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"plugins": ["@typescript-eslint", "prettier"],
|
|
||||||
"rules": {
|
|
||||||
"prettier/prettier": "warn"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"semi": false,
|
|
||||||
"singleQuote": true,
|
|
||||||
|
|
||||||
"importOrderSeparation": true,
|
|
||||||
"importOrderSortSpecifiers": true,
|
|
||||||
"importOrderParserPlugins": ["typescript", "decorators-legacy"],
|
|
||||||
|
|
||||||
"plugins": ["@trivago/prettier-plugin-sort-imports"]
|
|
||||||
}
|
|
||||||
24
biome.json
Normal file
24
biome.json
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||||
|
"organizeImports": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"formatter": {
|
||||||
|
"indentStyle": "space"
|
||||||
|
},
|
||||||
|
"javascript": {
|
||||||
|
"formatter": {
|
||||||
|
"semicolons": "asNeeded",
|
||||||
|
"quoteStyle": "single"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": {
|
||||||
|
"ignore": ["node_modules", "dist"]
|
||||||
|
}
|
||||||
|
}
|
||||||
19
package.json
19
package.json
|
|
@ -14,24 +14,13 @@
|
||||||
"release": "semantic-release",
|
"release": "semantic-release",
|
||||||
"prepack": "pnpm build"
|
"prepack": "pnpm build"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": ["comcigan", "parser", "typescript", "school", "korean"],
|
||||||
"comcigan",
|
|
||||||
"parser",
|
|
||||||
"typescript",
|
|
||||||
"school",
|
|
||||||
"korean"
|
|
||||||
],
|
|
||||||
"author": "Starcea <stardev.uwu@gmail.com>",
|
"author": "Starcea <stardev.uwu@gmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a",
|
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
"@biomejs/biome": "^1.8.3",
|
||||||
"@types/node": "^20.14.9",
|
"@types/node": "^20.14.9",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
||||||
"@typescript-eslint/parser": "^7.14.1",
|
|
||||||
"eslint": "^8.57.0",
|
|
||||||
"eslint-config-prettier": "^9.1.0",
|
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
|
||||||
"prettier": "^3.3.2",
|
"prettier": "^3.3.2",
|
||||||
"rimraf": "^5.0.7",
|
"rimraf": "^5.0.7",
|
||||||
"semantic-release": "^24.0.0",
|
"semantic-release": "^24.0.0",
|
||||||
|
|
@ -43,8 +32,6 @@
|
||||||
"iconv-lite": "^0.6.3"
|
"iconv-lite": "^0.6.3"
|
||||||
},
|
},
|
||||||
"release": {
|
"release": {
|
||||||
"branches": [
|
"branches": ["release"]
|
||||||
"release"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1028
pnpm-lock.yaml
generated
1028
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,4 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": [
|
"extends": ["config:recommended"]
|
||||||
"config:recommended"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
|
import axios from 'axios'
|
||||||
import { BASE_URL, USER_AGENT } from './constants'
|
import { BASE_URL, USER_AGENT } from './constants'
|
||||||
import DataManager from './data'
|
import DataManager from './data'
|
||||||
import School from './models/School'
|
import School from './models/School'
|
||||||
import type Timetable from './models/Timetable'
|
import type Timetable from './models/Timetable'
|
||||||
import { encodeBase64, encodeEUCKR } from './utils/encode'
|
import { encodeBase64, encodeEUCKR } from './utils/encode'
|
||||||
import { parseResponse } from './utils/parse'
|
import { parseResponse } from './utils/parse'
|
||||||
import axios from 'axios'
|
|
||||||
|
|
||||||
export default class Comcigan {
|
export default class Comcigan {
|
||||||
private readonly rest = axios.create({
|
private readonly rest = axios.create({
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ export const RegExes = {
|
||||||
/** 요일 */
|
/** 요일 */
|
||||||
export enum Weekday {
|
export enum Weekday {
|
||||||
Monday = 1,
|
Monday = 1,
|
||||||
Tuesday,
|
Tuesday = 2,
|
||||||
Wednesday,
|
Wednesday = 3,
|
||||||
Thursday,
|
Thursday = 4,
|
||||||
Friday,
|
Friday = 5,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { RegExes } from './constants'
|
|
||||||
import type { AxiosInstance } from 'axios'
|
import type { AxiosInstance } from 'axios'
|
||||||
import { decode } from 'iconv-lite'
|
import { decode } from 'iconv-lite'
|
||||||
|
import { RegExes } from './constants'
|
||||||
|
|
||||||
interface Data {
|
interface Data {
|
||||||
mainRoute: string
|
mainRoute: string
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { encode } from 'iconv-lite'
|
import { encode } from 'iconv-lite'
|
||||||
|
|
||||||
export const encodeEUCKR = (str: string) =>
|
export const encodeEUCKR = (str: string) =>
|
||||||
[...encode(str, 'euc-kr')].map((v) => '%' + v.toString(16)).join('')
|
[...encode(str, 'euc-kr')].map((v) => `%${v.toString(16)}`).join('')
|
||||||
|
|
||||||
export const encodeBase64 = (str: string) => Buffer.from(str).toString('base64')
|
export const encodeBase64 = (str: string) => Buffer.from(str).toString('base64')
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { RegExes } from '../constants'
|
import { RegExes } from '../constants'
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// biome-ignore lint/suspicious/noExplicitAny: any as default
|
||||||
export const parseResponse = <T = any>(str: string): T =>
|
export const parseResponse = <T = any>(str: string): T =>
|
||||||
JSON.parse(str.replace(RegExes.WhiteSpace, ''))
|
JSON.parse(str.replace(RegExes.WhiteSpace, ''))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue