Skip to content

NEAR-Edu/eslint-config-near

Repository files navigation

eslint-config-near

This library is an ESlint configuration for NEAR projects.

Installation

To install this configuration run the following command:

npm install -D eslint-config-near

or

yarn add -D eslint-config-near

Usage

touch .eslintrc.cjs
mkdir .vscode
touch .vscode/settings.json

When configuring ESlint to use this configuration add the following to your config file:

.eslintrc.cjs

/* eslint-env node */

module.exports = {
  extends: ["near"],
};

Feel free to customize, such as by adding rules as a sibling of extends such as:

rules: {
  'no-console': 'off',
}

You might also want to create something like .vscode/settings.json:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.formatOnSave": true,
  "eslint.workingDirectories": ["./server", "./src", "./shared"]
}

See also

Inspiration

This config is based on the eslint-config-canonical with some minor changes and setup for different filetypes.

Building

To build the project just run the build script like:

npm run build

Publishing

There is no need for manual publishing as this process is done in CI by semantic-release.