1.1.1 • Published 2 years ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

1.1.0

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.34

2 years ago

1.0.29

2 years ago

1.0.30

2 years ago

1.0.26

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.19

2 years ago

1.0.20

2 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.9

3 years ago

1.0.10

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago