1.0.10 • Published 1 year ago

@clubdrei/eslint-plugin-clubdrei v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

eslint-plugin-clubdrei

Eslint plugin with default rule configurations and custom rules for clubdrei projects

If you want to add a rule or update the packages use the developerGuide

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @clubdrei/eslint-plugin-clubdrei:

npm install @clubdrei/eslint-plugin-clubdrei --save-dev

Next, install peerDependencies

Usage

Add clubdrei to the extends section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix.
With /vanilla and /vue you can select the right config.

{
  "extends": [
    "plugin:@clubdrei/clubdrei/vanilla"
  ]
}
{
  "extends": [
    "plugin:@clubdrei/clubdrei/vue"
  ]
}

When you want to overwrite a plugin rule add clubdrei to the plugin section of your .eslintrc configuration file.

{
  "plugins": [
    "@clubdrei/clubdrei"
  ]
}

Currently settings and parserOption are not included in the configs. So add our defaults:

{
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module',
    //only needed on vanilla-js projects
    parser: '@babel/eslint-parser',
  },
  settings: {
    'import/resolver': {
      alias: {
        map: [
          ['@', './src'],
          ['@ssr', './ssr'],
          ['@tests', './tests'],
        ],
        extensions: ['.js', '.scss', '.vue'],
      },
    },
    'import/extensions': ['error', 'ignorePackages', { vue: 'always', js: 'always' }],
  },
}

Custom Rules

RuleOptionsShort DescriptionType
length-conditionnoneForces conditions with .length, to use a comparisonVanilla
force-trim-length-on-empty-string-checksnoneForces to use .trim().lengthto check if an string is EmptyVanilla
vue-watch-ordernoneForces Order in watch: immediate, deep, handlerVue
vue-force-handler-in-watchnoneForces to use handler() in watchVue
vue-no-complex-keys-in-watch'allowedPropertyLevel': numberNot allow test.foo in watchVue
filename-convention'expect': string[], 'extensions': string[]defines naming of filesVanilla
vue-force-trim-length-on-empty-string-checksnoneExpand force-trim-length-on-empty-string-checks rule, to check the types of vue propsVue
force-equal-zerononenot allow foo < 1 for zero checksVanilla
vue-no-multiple-quotes-in-component-propsnoneforbids double quotes in vue attributesVue
1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.9.9

2 years ago

0.9.8

2 years ago

0.9.7

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago

0.7.1

2 years ago