Skip to content

Shared personal ECMAScript Config (TS, Lint, Prettier)

License

Notifications You must be signed in to change notification settings

nihalgonsalves/esconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esconfig

Shared ECMAScript Config (TS, Lint, Prettier)

Usage

  1. Install

    yarn add -D @nihalgonsalves/esconfig typescript typescript-eslint eslint prettier
  2. tsconfig.json

    {
      "extends": "@nihalgonsalves/esconfig/tsconfig.shared.json",
      "compilerOptions": {
        "outDir": "./build",
        "rootDir": "./src"
      },
      "include": ["./src"]
    }
  3. eslint.config.mjs

    import tseslint from "typescript-eslint";
    
    import sharedConfig from "@nihalgonsalves/esconfig/eslint.config.shared";
    
    export default tseslint.config(
      { ignores: [] },
      ...sharedConfig,
      // ... others
    );

    If you're using React:

    import tseslint from "typescript-eslint";
    
    import sharedConfig from "@nihalgonsalves/esconfig/eslint.config.react-shared";
    
    export default tseslint.config(
      { ignores: [] },
      ...sharedConfig,
      // ... others
    );
  4. package.json

    {
      "scripts": {
        "build": "tsc",
        "lint": "eslint ./src/",
        "format": "prettier . --write",
        "format:check": "prettier . --check"
      }
    }
  5. Done! Don't forget to run build, lint and format:check in your CI workflow.

About

Shared personal ECMAScript Config (TS, Lint, Prettier)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages