5.2.0 • Published 4 months ago

@linzjs/style v5.2.0

Weekly downloads
360
License
MIT
Repository
github
Last release
4 months ago

@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
npm install @linzjs/style
  1. Applying eslint config There are two ways to apply the config

Either create the base configuration files

# If on windows run `node ./node_modules/@linzjs/style/build/src/install.js`
# - tsconfig.json
# - .eslintrc.cjs
# - .prettierrc.cjs
npx linz-style-install

Or extend your existing eslintrc.js config

Example extending the .eslintrc.js file in your project

module.exports = {
  extends: ["./node_modules/@linzjs/style/.eslintrc.cjs"],

  overrides: [
    {
      /** Overrides for typescript */
      files: ["**/*.ts", "**/*.tsx"],      
      rules: {
        "@typescript-eslint/super-crazy-hook-rule": "error",
      },
    },
  ]
}
  1. Apply the formatting/linting to all source code
npx eslint .

Migration from 3.x to 4.x

See Migration Docs

5.2.0

4 months ago

5.1.0

6 months ago

5.0.0

8 months ago

4.1.0

11 months ago

4.0.0

12 months ago

4.2.0

11 months ago

3.16.0

1 year ago

3.15.0

1 year ago

3.14.0

1 year ago

3.13.0

1 year ago

3.12.0

2 years ago

3.11.0

2 years ago

3.10.0

2 years ago

3.9.0

2 years ago

3.8.0

2 years ago

3.7.0

2 years ago

3.4.0

2 years ago

3.6.0

2 years ago

3.5.0

2 years ago

3.3.0

3 years ago

3.2.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.1.5

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

1.2.0

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.3

4 years ago