8.2.1 • Published 24 days ago

@sparticuz/eslint-config v8.2.1

Weekly downloads
24
License
ISC
Repository
-
Last release
24 days ago

eslint-config

My eslint config

I use this on projects that I develop.

Included in the readme is also Typescript, Prettier, Vitest configs for bootstrapping new projects.

Install

npm install --save-dev @sparticuz/eslint-config typescript-eslint typescript prettier vitest @tsconfig/node20 @tsconfig/strictest

Example package.json

"scripts": {
  "build": "rm -rf dist/** && tsc -p tsconfig.build.json",
  "lint": "eslint \"**/*.?(c|m)[jt]s?(x)\"",
  "test": "vitest run --coverage"
},

Example eslint.config.js

// @ts-check
import myConfig from "@sparticuz/eslint-config";
import tseslint from "typescript-eslint";

export default tseslint.config(
  {
    ignores: ["dist/**/*"],
  },
  ...myConfig,
);

Example prettier.config.js

/** @type {import("prettier").Config} */
export const config = {
  trailingComma: "all",
};
export default config;

Example Typescript config

tsconfig.json

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Base Default TSConfig",
  "extends": ["@tsconfig/node20/tsconfig", "@tsconfig/strictest/tsconfig"],
  "compilerOptions": {
    "declaration": true,
    "declarationMap": true,
    "exactOptionalPropertyTypes": false,
    "lib": ["DOM", "ES2023"],
    "module": "NodeNext",
    "moduleResolution": "nodenext",
    "noUnusedLocals": false,
    "outDir": "dist",
    "resolveJsonModule": true,
    "sourceMap": true
  },
  "include": ["src", "test"]
}

tsconfig.build.json

{
  // extend your base config to share compilerOptions, etc
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "dist",
    "removeComments": true,
    "sourceMap": false
  },
  "exclude": ["test"]
}

Example vitest.config.ts

import { loadEnv } from "vite";
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    coverage: {
      reportOnFailure: true,
      reporter: ["json", "json-summary", "text"],
    },
    env: loadEnv("", process.cwd(), ""),
  },
});
8.2.1

24 days ago

8.1.0

28 days ago

8.2.0

28 days ago

8.0.4

1 month ago

8.0.1

1 month ago

8.0.3

1 month ago

8.0.2

1 month ago

7.7.1

4 months ago

7.6.0

4 months ago

7.7.0

4 months ago

7.4.4

10 months ago

7.4.8

8 months ago

7.4.7

8 months ago

7.4.6

9 months ago

7.4.5

10 months ago

7.5.0

6 months ago

7.3.0

11 months ago

7.2.6

11 months ago

7.2.5

11 months ago

7.4.0

11 months ago

7.2.4

1 year ago

7.2.3

1 year ago

7.2.2

1 year ago

7.2.1

1 year ago

7.2.0

1 year ago

7.1.11

2 years ago

7.1.10

2 years ago

7.1.3

2 years ago

7.1.5

2 years ago

7.1.8

2 years ago

6.2.1

2 years ago

7.0.0

2 years ago

7.1.2

2 years ago

7.1.1

2 years ago

6.2.0

2 years ago

6.0.0

2 years ago

6.1.1

2 years ago

5.0.0

3 years ago

4.0.5

3 years ago

4.0.4

3 years ago

4.0.0

3 years ago

3.7.0

3 years ago

3.6.0

3 years ago

3.5.5

3 years ago

3.5.4

3 years ago

3.5.3

3 years ago

3.5.2

3 years ago

3.5.1

3 years ago

3.3.9

3 years ago

3.3.8

3 years ago

3.4.0

3 years ago

3.3.7

3 years ago

3.3.5

3 years ago

3.3.4

4 years ago

3.3.3

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago