All Projects → NullVoxPopuli → eslint-plugin-decorator-position

NullVoxPopuli / eslint-plugin-decorator-position

Licence: MIT license
ESLint plugin for enforcing decorator position

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects
typescript
32286 projects

Projects that are alternatives of or similar to eslint-plugin-decorator-position

eslint-plugin
autofix some errors reported by eslint rules.
Stars: ✭ 74 (+131.25%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-rulesdir
An ESLint plugin to load project-specific ESLint rules
Stars: ✭ 28 (-12.5%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Mocha
ESLint rules for mocha
Stars: ✭ 249 (+678.13%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Ava
ESLint rules for AVA
Stars: ✭ 209 (+553.13%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-react-hook-form
ESLint plugin for react-hook-form
Stars: ✭ 27 (-15.62%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Eslint Comments
Additional ESLint rules for directive comments of ESLint.
Stars: ✭ 221 (+590.63%)
Mutual labels:  eslint, eslint-plugin
html-eslint
ESLint plugin for linting HTML
Stars: ✭ 72 (+125%)
Mutual labels:  eslint, eslint-plugin
Eslint Import Resolver Alias
a simple Node behavior import resolution plugin for eslint-plugin-import, supporting module alias
Stars: ✭ 121 (+278.13%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-svelte
ESLint plugin for Svelte using AST
Stars: ✭ 22 (-31.25%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-disable
Disable ESLint plugins using file path patterns and inline comments
Stars: ✭ 51 (+59.38%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Lodash
ESLint rules for lodash
Stars: ✭ 208 (+550%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-layout-shift
ESLint plugin to force responsive media elements to set the width/height attributes
Stars: ✭ 15 (-53.12%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Boundaries
Eslint plugin checking architecture boundaries between elements
Stars: ✭ 157 (+390.63%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Ember
An ESlint plugin that provides set of rules for Ember Applications based on commonly known good practices.
Stars: ✭ 240 (+650%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Unicorn
Various awesome ESLint rules
Stars: ✭ 2,157 (+6640.63%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-pug
An ESLint plugin for linting inline scripts in Pug files
Stars: ✭ 17 (-46.87%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin I18n Json
Fully extendable eslint plugin for JSON i18n translation files.
Stars: ✭ 101 (+215.63%)
Mutual labels:  eslint, eslint-plugin
Eslint Plugin Css Modules
Project status: NOT MAINTAINED; Checks that you are using the existent css/scss classes, no more no less
Stars: ✭ 115 (+259.38%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-editorconfig
An ESLint plugin to enforce EditorConfig rules
Stars: ✭ 22 (-31.25%)
Mutual labels:  eslint, eslint-plugin
eslint-plugin-ban
Ban some methods and functions
Stars: ✭ 23 (-28.12%)
Mutual labels:  eslint, eslint-plugin

eslint-plugin-decorator-position

NPM version NPM downloads

An ESlint plugin that provides set of rules enforcing consistent decorator positions

❗️Requirements

🚀 Usage

1. Install plugin

yarn add --dev eslint-plugin-decorator-position

Or

npm install --save-dev eslint-plugin-decorator-position

2. Modify your .eslintrc.js

// .eslintrc.js
module.exports = {
  parser: 'babel-eslint',
  // parser: '@typescript-eslint/parser',
  plugins: ['decorator-position'],
  extends: [
    'plugin:decorator-position/ember' // or other configuration
  ],
  rules: {
    // override rule settings from extends config here
    // 'decorator-position/decorator-position': ['error', { /* your config */ }]
  }
};

🧰 Configurations

Name Description
base contains no rules settings, but the basic eslint configuration suitable for any project. You can use it to configure rules as you wish.
🐹 ember extends the base configuration by enabling the recommended rules for ember projects.

🍟 Rules

Rules are grouped by category to help you understand their purpose. Each rule has emojis denoting:

  • What configuration it belongs to
  • 🔧 if some problems reported by the rule are automatically fixable by the --fix command line option

Style

Rule ID Description
🔧 decorator-position Enforces consistent decorator position on properties and methods

For the simplified list of rules, go here.

🍻 Contribution Guide

If you have any suggestions, ideas, or problems, feel free to create an issue, but first please make sure your question does not repeat previous ones.

Creating a New Rule

  • Create an issue with a description of the proposed rule
  • Create files for the new rule:
    • lib/rules/new-rule.js (implementation, see no-proxies for an example)
    • docs/rules/new-rule.md (documentation, start from the template -- raw, rendered)
    • tests/lib/rules/new-rule.js (tests, see no-proxies for an example)
  • Run yarn update to automatically update the README and other files (and re-run this if you change the rule name or description)
  • Make sure your changes will pass CI by running:
    • yarn test
    • yarn lint (yarn lint:js --fix can fix many errors)
  • Create a PR and link the created issue in the description

Note that new rules should not immediately be added to the recommended configuration, as we only consider such breaking changes during major version updates.

Running smoke tests and creating reproductions

To run smoke tests:

./scripts/smoke-test.sh

it will prompt you with which test to run.

To create a reproduction,

  1. first make sure there is an open issue describing the problem your encountering.
  2. then create a folder in smoke-tests/issue-reproductions/ named ofter the issue number. example: smoke-tests/issue-reproductions/196/
  3. The minimum required files are:
    • package.json - for declaring which dependencies are being tested (or * if it doesn't matter for your particular test)
    • a js or ts file to demonstrate the "correct" state. After a smoke-test runs, a git diff is checked to ensure 0 changes.
    • .eslintrc.js - to define what configuration / rules / plugins / etc may be relevant.

SemVer Policy

How does this project interpret patch / minor / breaking changes?

  • patch: a change that fixes currently broken behavior. Does not cause formatting to change when people update unless a previous patch/feature accidentally broke formatting in a breaking way.
  • minor: a change that does not impact formatting
  • breaking: a major change that is not backwards compatible and would intentionally cause formatting changes to occur

🔓 License

See the LICENSE file for license rights and limitations (MIT).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].