38 lines
950 B
TypeScript
38 lines
950 B
TypeScript
import js from "@eslint/js";
|
|
import globals from "globals";
|
|
import tseslint from "typescript-eslint";
|
|
import { defineConfig } from "eslint/config";
|
|
|
|
export default defineConfig([
|
|
{
|
|
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
|
|
plugins: { js },
|
|
extends: ["js/recommended"],
|
|
languageOptions: { globals: globals.browser },
|
|
},
|
|
|
|
// Presets
|
|
...tseslint.configs.recommended,
|
|
|
|
// Overrides
|
|
{
|
|
files: ["**/*.ts"],
|
|
rules: {
|
|
"no-restricted-syntax": [
|
|
"warn",
|
|
{
|
|
selector: "CallExpression[callee.property.name='splice']",
|
|
message:
|
|
"For deleting a single item, prefer using `(deli(array, index+1)` from Picotron's api.",
|
|
},
|
|
],
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ argsIgnorePattern: "^_" },
|
|
],
|
|
"@typescript-eslint/strict-boolean-expressions": "error",
|
|
},
|
|
},
|
|
]);
|