1.1.1 • Published 3 years ago

@smarlhens/opinionated-safe-code-normalizer v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Opinionated safe code normalizer

TypeScript opinionated safe code normalizer using ts-morph & ESLint.

GitHub CI node-current (scoped) GitHub license Commitizen friendly code style: prettier Conventional Commits

This tool helps you to add public keyword to your code methods, properties, getters & setters to be compliant with @typescript-eslint/explicit-member-accessibility rule.


Table of Contents


Prerequisites

  • Node.JS version ^14.17.0 || >=16.0.0

Installation

Install globally:

npm install -g @smarlhens/opinionated-safe-code-normalizer

Usage

Use inside a directory which contain an .eslintrc.js configuration file and **/*.ts files (can be in subdirectories of the working directory).
Using ts-morph & ESLint, your code will be updated adding public keyword to methods, properties, getters & setters.

$ oscn

Example

class Foo {
  private propA: string;
  protected propB: string;
  public propC?: string;
- propD?: string;
+ public propD?: string;

  private _propE?: string;

- get propE(): string | undefined {
* public get propE(): string | undefined {
    return this._propE;
  }

- set propE(value: string | undefined) {
+ public set propE(value: string | undefined) {
    this._propE = value;
  }

  constructor() {
    this.propA = 'lorem';
    this.propB = 'ispum';
  }

- methodA(): void {}
+ public methodA(): void {}
}

1.1.1

3 years ago

1.1.0

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.34

3 years ago

1.0.29

3 years ago

1.0.30

3 years ago

1.0.26

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.19

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago