Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 0 additions & 147 deletions .eslintrc.js

This file was deleted.

23 changes: 10 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
node-version: [22, 24, 26]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}

- name: EditorConfig Lint
uses: docker://mstruebing/editorconfig-checker:2.7.2
uses: docker://mstruebing/editorconfig-checker:4.0.1

- name: Install
run: |
yarn config set ignore-engines true
yarn
run: yarn

- name: Build
run: yarn build
Expand All @@ -31,11 +29,10 @@ jobs:
run: yarn lint

- name: Test
run: |
yarn test > COVERAGE_RESULT
echo "$(cat COVERAGE_RESULT)"
run: yarn test

- name: Coveralls
uses: coverallsapp/github-action@master
- name: Codecov
if: matrix.node-version == 24
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
56 changes: 56 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"ignorePatterns": [
"**/node_modules",
"**/dist",
"**/coverage",
"**/*.js",
"**/*.d.ts"
],
"plugins": [
"typescript",
"vitest"
],
"env": {
"node": true
},
"categories": {
"correctness": "error",
"suspicious": "error"
},
"rules": {
"no-var": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"eqeqeq": "error",
"curly": "error",
"no-console": "error",
"no-else-return": "error",
"dot-notation": "error",
"object-shorthand": "error",
"no-throw-literal": "error",
"yoda": "error",
"typescript/no-explicit-any": "off",
"typescript/no-non-null-assertion": "off",
"typescript/ban-ts-comment": "off",
"typescript/no-unused-vars": "off",
"typescript/array-type": "error",
"typescript/consistent-type-assertions": "error",
"typescript/no-inferrable-types": "error",
"typescript/no-namespace": "error",
"typescript/no-this-alias": "error",
"typescript/prefer-optional-chain": "error",
"typescript/no-useless-constructor": "error"
},
"globals": {
"describe": "readonly",
"test": "readonly",
"expect": "readonly",
"beforeAll": "readonly",
"afterAll": "readonly",
"beforeEach": "readonly",
"afterEach": "readonly",
"vi": "readonly"
}
}
37 changes: 12 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,21 @@
"build": "yarn clean && yarn compile && yarn copy",
"clean": "rimraf ./dist",
"compile": "tsc -p tsconfig.json",
"copy": "ts-node -T ./scripts/copy.ts",
"lint": "eslint src/*.ts",
"test": "jest"
},
"jest": {
"preset": "ts-jest",
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/src/**/*.ts"
],
"modulePathIgnorePatterns": [
"dist/package.json",
"<rootDir>/package.json"
]
"copy": "node ./scripts/copy.js",
"lint": "oxlint src tests",
"test": "vitest run"
},
"dependencies": {
"ansi-colors": "^4.1.1"
},
"devDependencies": {
"@types/jest": "^27.0.0",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "~5.50.0",
"@typescript-eslint/parser": "~5.50.0",
"eslint": "^7.6.0",
"jest": "^27.0.0",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.0",
"ts-node": "^10.0.0",
"typescript": "^4.0.0"
}
"@types/node": "^24.0.0",
"@vitest/coverage-v8": "^5.0.0",
"oxlint": "^1.81.0",
"rimraf": "^6.1.3",
"typescript": "^7.0.2",
"vite": "^8.2.2",
"vitest": "^5.0.0"
},
"packageManager": "yarn@1.22.22"
}
10 changes: 5 additions & 5 deletions scripts/copy.ts → scripts/copy.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { copyFileSync, readFileSync, writeFileSync } from 'fs';
import { resolve } from 'path';
const { copyFileSync, readFileSync, writeFileSync } = require('fs');
const { resolve } = require('path');

function copy(filename: string, from: string, to: string): void {
function copy(filename, from, to) {
copyFileSync(resolve(from, filename), resolve(to, filename));
}

function rewrite(path: string, replacer: (from: string) => string): void {
function rewrite(path, replacer) {
const file = readFileSync(path).toString();
const replaced = replacer(file);
writeFileSync(path, replaced);
Expand All @@ -15,6 +15,6 @@ const root = resolve(__dirname, '..');
const target = resolve(process.cwd(), 'dist');

copy('README.md', root, target);
copy('LICENSE', root, target);
copy('LICENSE', root, target);
copy('package.json', process.cwd(), target);
rewrite(resolve(target, 'package.json'), pkg => pkg.replace(/dist\//g, ''));
Loading