Make APIs more similar

This commit is contained in:
Darren Clarke 2026-02-15 10:29:52 +01:00
parent 9f0e1f8b61
commit c40d7d056e
57 changed files with 3994 additions and 1801 deletions

View file

@ -0,0 +1,52 @@
import tseslint from "@typescript-eslint/eslint-plugin";
import tsparser from "@typescript-eslint/parser";
import prettier from "eslint-config-prettier";
import unicorn from "eslint-plugin-unicorn";
import importX from "eslint-plugin-import-x";
export default [
{
files: ["**/*.ts"],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
},
},
plugins: {
"@typescript-eslint": tseslint,
unicorn,
"import-x": importX,
},
rules: {
...tseslint.configs.recommended.rules,
...unicorn.configs.recommended.rules,
// Relax unicorn rules
"unicorn/no-null": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-process-exit": "off",
"unicorn/prefer-top-level-await": "off",
// Import rules
"import-x/no-duplicates": "error",
"import-x/order": [
"error",
{
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
"newlines-between": "always",
alphabetize: { order: "asc" },
},
],
// TypeScript rules
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/no-explicit-any": "warn",
},
},
prettier,
];

View file

@ -0,0 +1,20 @@
{
"name": "@link-stack/eslint-config",
"version": "3.5.0-beta.1",
"private": true,
"type": "module",
"exports": {
"./node": "./node.js"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^8.29.0",
"@typescript-eslint/parser": "^8.29.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-unicorn": "^58.0.0",
"eslint-plugin-import-x": "^4.12.2"
},
"peerDependencies": {
"eslint": "^9",
"typescript": "^5"
}
}