0.9.0 β€’ Published 1 year ago

@bud-tools/eslint-plugin-bt-plugin v0.9.0

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
1 year ago

eslint-plugin-bt-plugin

Helpful eslint rules for bt plugins.

Use these rules in a bt plugin

yarn add --dev eslint-plugin-bt-plugin

Then, in your plugin's .eslintrc.js, add "plugin:bt-plugin/recommended" to your extends property.

example:

module.exports = {
  extends: ['@bud-tools/eslint-config-budtools-typescript', 'plugin:@bud-tools/bt-plugin/recommended'],
};

To override how an individual rules behaves, add the plugin name and change the its rules value.

plugins: ['bt-plugin'],
rules: {
  'bt-plugin/no-hardcoded-messages': 'error'
}

Use these rules to migrate a plugin based on btdxCommand to use btCommand

These eslint rules are experimental and cause significant code changes. Please use with caution and test changes thoroughly

yarn add @bud-tools/bt-plugins-core
yarn add --dev @bud-tools/eslint-plugin-bt-plugin

migration includes all of the recommended rules, so you don't have to include both

module.exports = {
  extends: ['@bud-tools/eslint-config-budtools-typescript', 'plugin:@bud-tools/bt-plugin/migration'],
};

Rules

πŸ’Ό Configurations enabled in.\ ⚠️ Configurations set to warn in.\ πŸ“š Set in the library configuration.\ ✈️ Set in the migration configuration.\ βœ… Set in the recommended configuration.\ πŸ”§ Automatically fixable by the --fix CLI option.\ πŸ’‘ Manually fixable by editor suggestions.

NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β DescriptionπŸ’Όβš οΈπŸ”§πŸ’‘
command-exampleEnsure commands have a summary, description, and examples✈️ βœ…
command-summaryEnsure commands have a summary✈️ βœ…πŸ”§
dash-oWarn on a flag that uses -o✈️ βœ…
encourage-alias-deprecationCommands and flags aliases probably want to deprecate their old names to provide more warnings to usersβœˆοΈπŸ”§πŸ’‘
flag-caseEnforce lowercase kebab-case flag names✈️ βœ…πŸ”§
flag-cross-referencesEnforce flag cross references for dependOn,exclusive,exactlyOne✈️ βœ…
flag-min-max-defaultEnforce that flags with min/max values have a default value✈️ βœ…
flag-summaryEnforce that flags have a summary property and that longDescription is renamed to description✈️ βœ…πŸ”§
get-connection-with-versionCalls to getConnection should pass in a version✈️ βœ…
id-flag-suggestionsCreate better budtoolsId flags with length and startsWith properties✈️ βœ…πŸ”§πŸ’‘
no-args-parse-without-strict-falseIf you parse args/argv, the class should have strict set to false✈️ βœ…πŸ”§
no-builtin-flagsHandling for btdxCommand's flags.builtinβœˆοΈπŸ”§
no-deprecated-propertiesRemoves non-existent properties left over from BtdxCommandβœˆοΈπŸ”§
no-duplicate-short-charactersPrevent duplicate use of short characters or conflicts between aliases and flags✈️ βœ…
no-filepath-flagsChange filepath flag to file flagπŸ”§
no-h-short-charDo not allow creation of a flag with short char -h✈️ βœ…
no-hardcoded-messages-commandsUse loaded messages and separate files for messages✈️ βœ…
no-hardcoded-messages-flagsUse loaded messages and separate files for messages✈️ βœ…
no-id-flagsChange Id flag to budtoolsIdβœˆοΈπŸ”§
no-json-flagDo not allow creation of json flag✈️ βœ…
no-missing-messagesChecks core Messages usage for correct usage of named messages and message tokensπŸ“š ✈️ βœ…
no-number-flagsChange number flag to integerπŸ”§
no-oclif-flags-command-importChange import of flags and Command from oclif to use bt-plugins-core✈️ βœ…πŸ”§
no-btdx-command-importChange import and base class from BtdxCommand to btCommandβœˆοΈπŸ”§
no-split-examplesArrays of messags should use getMessages instead of getMessage followed by EOL splitting✈️ βœ…πŸ”§
no-this-flagsFix references to this.org (property on BtdxCommand)βœˆοΈπŸ”§πŸ’‘
no-this-orgFix references to this.org (property on BtdxCommand)βœˆοΈπŸ”§πŸ’‘
no-this-uxBtCommand does not have a ux propertyβœˆοΈπŸ”§
no-time-flagsMigrate time flags to Flags.durationβœˆοΈπŸ”§
no-unnecessary-aliasesMark when an alias is unnecessary because its only an order permutation, not really a different name✈️ βœ…πŸ”§
no-unnecessary-propertiesBoolean properties are false by default, so they should not be set to false✈️ βœ…πŸ”§
no-username-propertiesConvert requiresUsername and supportusername to username flagsβœˆοΈπŸ”§
read-only-propertiesClass-level static properties, like flags or descriptions, should be marked read-only✈️ βœ…πŸ”§
run-matches-class-typeThe return type of the run method should match the Type passed to btCommand✈️ βœ…πŸ”§
btdx-flags-propertyChange flag definitions to BtCommand versionβœˆοΈπŸ”§
should-parse-flagsThe run method should call this.parse when there are flagsβœˆοΈπŸ”§
use-bt-command-flagsUse Flags export from bt-plugins-coreβœˆοΈπŸ”§
0.9.0

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.1

1 year ago