@linzjs/style

    3.6.0 • Public • Published

    @linzjs/style

    Build Status License

    NPM configuration for base typescript projects

    Includes:

    • Prettier
    • Eslint
    • Typescript

    And configuration for saneish defaults, which can be extended

    Most of these are the raw defaults/recommended settings from typescript, eslint and prettier.

    export class FooBar {
      get foo(): number {
        return 1;
      }
    
      async bar(): Promise<string> {
        return 'bar';
      }
    
      /**
       * @param foo foo to bar
       */
      fooBar(foo = 'foo'): string {
        return `${foo}bar`;
      }
    }

    IDE Usage

    Usage VS Code

    1. Install eslint using the extensions menu
    2. Add the following to your settings.json
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "eslint.validate": ["javascript"],

    Usage with IntelliJ

    IntelliJ has ESLint support by default,

    1. Open the settings in Languages & Frameworks > JavaScript > Code Quality Tools > ESLint
    2. Check Automatic ESLint Configuration

    Project Usage

    1. Install LINZ Style
    yarn add -D @linzjs/style
    # Or
    npm install @linzjs/style
    1. Create the base configuration files
    # If on windows run `node node_modules\@linzjs\style\build\src\install.js`
    # - tsconfig.json
    # - .eslintrc.js
    # - .prettierrc.js
    npx linz-style-install
    1. Apply the formatting/linting to all source code
    npx eslint src/**/*.ts
    

    Keywords

    none

    Install

    npm i @linzjs/style

    DownloadsWeekly Downloads

    8,251

    Version

    3.6.0

    License

    MIT

    Unpacked Size

    58.6 kB

    Total Files

    27

    Last publish

    Collaborators

    • linzds
    • blacha
    • philals