Coder Social home page Coder Social logo

victorbojica / eslint-plugin-more-naming-conventions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codingkoopa/eslint-plugin-more-naming-conventions

0.0 1.0 0.0 31 KB

A plugin for the ESLint linter that adds more naming conventions for variables and functions.

License: GNU General Public License v3.0

JavaScript 100.00%

eslint-plugin-more-naming-conventions's Introduction

eslint-plugin-more-naming-conventions

eslint-plugin-more-naming-conventions is a plugin for the ESLint JavaScript linting utility. It introduces rules that add more naming conventions for variables, functions, classes, and methods.

Setup

  1. Open up a terminal or command prompt in the project to lint.
  2. Follow the instructions to install ESLint here.
  3. Install eslint-plugin-more-naming-conventions with the NPM package manager:
npm install eslint-plugin-more-naming-conventions
  1. Follow the instructions to add the plugin to your configuration file here.
  2. Follow the instructions to add the plugin rules to your configuration file here.

Then configure the rules you want to use under the rules section.

Rules

All rules support fixing errors automatically.

snake-case-variables

snake-case-variables ensures that all variables defined are in snake case, consisting of all lower case letters, with words separated by underscores (_s).

Good:

  • variable_name
  • variable
  • CONSTANT_NAME
  • ClassName (For when the old class syntax is used for defining a class.)

Bad:

  • variableName

upper-camel-case-functions

upper-camel-case-functions ensures that all functions, classes, and methods defined are in upper camel case, consisting of lower and upper case letters, with words separated by the letter changing to upper case.

Good:

  • VariableName
  • Variable

Bad:

  • variableName
  • variable
  • variable_name

Automatic Fixing

The way fixing function calls work, in relation to module exports, is that the plugin scans variable definitions initialized to the value of require(), with arguments including the character /, and adds it to a whitelist. This whitelist now has variables included from other packages filtered out, so it won't try to correct case errors in other packages, or builtin objects. However, if you have a local (A JS file in your project included via a path.) that is an extention of an object exposing camel case functions, and those functions are called, the plugin will try to correct them.

eslint-plugin-more-naming-conventions's People

Contributors

victorbojica avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.