This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@flutteruki-gaming/test-eslint-config-flutteruki-gaming

1.6.18 • Public • Published

ESlint Shareable Config

Flutteruki-Gaming

ESlint npm

Table of Contents

Table of Contents
  1. ➤ About The Project
  2. ➤ Technologies
  3. ■ ESlint Setup
  4. ■ Prettier Setup
  5. ➤ Contributing and commit
  6. ➤ Triggering a library release

-----------------------------------------------------

About The Project

This package provides Flutteruki-Gaming's base JS .eslintrc (without React plugins) as an extensible shared config.

By default, the config contains most ESLint rules, including ECMAScript 6+. It comes with:

  • eslint
  • eslint-plugin-import
  • eslint-plugin-unused-imports

-----------------------------------------------------

Technology Stack

ESlint npm javascript

-----------------------------------------------------

ESlint Setup

Prerequisites:

  • Node 16 and above
  • npm

Config installation:

  1. Install following dependencies under devDependencies:
npm install --save-dev eslint@^8.2.0
npm install --save-dev eslint-plugin-import@^2.26.0
npm install --save-dev eslint-plugin-unused-imports@^2.0.0
  1. Run following command that will install the shareable config in your project:

npm install --save-dev @flutteruki-gaming/eslint-config-flutteruki-gaming

  1. Create .eslintrc.json file in your project's root directory and add the following content:
{
    "extends": ["@flutteruki-gaming/eslint-config-flutteruki-gaming"],
    "env": {
        "node": true,
        "jest": true
    }
}

Based on your project's needs you can add further rules that don't exist in the shareable config or override existing ones. Also, you can add other configs, plugins, globals, parsers, envs etc.

  1. The last step needed is to add linting scripts in your package.json under "scripts" object:
  "scripts": {
    ...
    "lint": "eslint .",
    "lint-fix": "eslint . --fix"
    ...
  }

First command will only highlight problems found in your project and the second one will fix issues automatically (if they can be fixed automatically).

You can run the above commands as:

npm run lint
npm run lint-fix

-----------------------------------------------------

Prettier Setup

Prerequisites:

  • Node 16 and above
  • npm

Config installation:

  1. Install following dependencies under devDependencies:
npm install --save-dev eslint-config-prettier@^8.6.0
npm install --save-dev eslint-plugin-prettier@^4.2.1
npm install --save-dev prettier@^2.8.4
  1. Create .prettierrc.json file in your project's root directory and add the following content:
{
    "printWidth": 120,
    "tabWidth": 4,
    "useTabs": false,
    "semi": true,
    "singleQuote": false,
    "trailingComma": "none",
    "bracketSpacing": true,
    "bracketSameLine": false,
    "arrowParens": "avoid",
    "endOfLine": "auto"
}

Based on your project's needs you can add further rules that don't exist in .prettierrc.json or modify existing ones. Note that Prettier doesn't have lots of options, so there are not many left to use.

  1. Modify your .eslintrc.json in order to support Prettier:
{
    "extends": ["prettier", "@flutteruki-gaming/eslint-config-flutteruki-gaming"],
    "plugins": ["prettier"],
    "rules": {
        "prettier/prettier": "error"
    },
    "env": {
        "node": true,
        "jest": true
    }
}
  1. The last step needed is to add the scripts needed in your package.json under "scripts" object:
  "scripts": {
    ...
    "prettier-check": "prettier . --check",
    "prettier-fix": "prettier . --write",
    "pre-staged": "npm run lint-fix && npm run prettier-fix"
    ...
  }

First command will only highlight problems found in your project and the second one will fix issues automatically (if they can be fixed automatically).

Best to use third command

Third command will both run ESlint and Prettier scripts in order to fix everything that can be fixed.

You can run the above commands as:

npm run prettier-check
npm run prettier-fix
npm run pre-staged

-----------------------------------------------------

Contributing and commits

Please follow the rules from our CONTRIBUTING guide.

-----------------------------------------------------

Triggering a library release

This library will be published automatically using Semantic Release based on your commit messages in your merge request.

Each merge into master branch will trigger a release that will be based on your commit messages.

If you want a Breaking, Feature or Fix release please follow the guide below.

Library Release Guide

The commit message should be structured as follows:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
Commit message Release type
fix(TP444444): stop graphite breaking when too much pressure applied Patch Fix Release
feat(TP444444): add 'graphiteWidth' option Minor Feature Release
feat(TP444444): remove graphiteWidth option

BREAKING CHANGE: The graphiteWidth option has been removed.
The default graphite width of 10mm is always used for performance reasons.
Major Breaking Release
(Note that the BREAKING CHANGE: token must be in the footer of the commit)

Let's assume that the current version of the library is 1.2.5

  • in case of merging a MR with a fix commit, the library will be automatically bumped to 1.2.6

  • in case of merging a MR with a feat commit, the library will be bumped to 1.3.0

  • in case of merging a MR with a commit that has BREAKING CHANGE: in the footer of the commit, the library will be bumped to 2.0.0

If you do not wish to trigger a release, please use the other types than fix/feat as listed below:

Types Accepted Description
feat Add a new feature to the codebase (MINOR in semantic versioning).
fix Fix a bug (equivalent to a PATCH in Semantic Versioning).
docs Documentation changes.
revert Revert a commit.
ci Code change related to CI (eg Jenkins, Pipelines)
build Code change related to a particular build.
style Code style change (semicolon, indentation...)
refactor Refactor the code
perf Update code performances.
test Add test to an existing feature.
chore Update something without impacting the user (ex: bump a dependency in package.json).

Package Sidebar

Install

npm i @flutteruki-gaming/test-eslint-config-flutteruki-gaming

Weekly Downloads

132

Version

1.6.18

License

ISC

Unpacked Size

39.1 MB

Total Files

19

Last publish

Collaborators

  • flutteruki