1.0.0 • Published 1 year ago

@f1stnpm3/debitis-corrupti-quasi v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@f1stnpm3/debitis-corrupti-quasi

Find and remove unused es6 module imports. It works by splitting up the no-unused-vars rule depending on it being an import statement in the AST and providing an autofix rule to remove the nodes if they are imports. This plugin composes the rule no-unused-vars of either the typescript or js plugin so be aware that the other plugins needs to be installed and reporting correctly for this to do so.

Versions

  • Version 3.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 6 - 7
  • Version 2.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 5
  • Version 1.x.x is for eslint 6 and 7.

Important for version 1.1

The -ts rules are deprecated, the package now looks for @typescript-eslint/eslint-plugin to exist to decide between the typescript and eslint version. The -ts rule will still work, but point to the new rule instead.

Typescript

If running typescript with @typescript-eslint make sure to use both @typescript-eslint/eslint-plugin and @typescript-eslint/parser.

React

If writing react code you need to install eslint-plugin-react and enable the two rules react/jsx-uses-react and react/jsx-uses-vars. Otherwise all imports for components will be reported unused.

Installation

You'll first need to install ESLint (and @typescript-eslint if using typescript):

npm i eslint --save-dev

Next, install @f1stnpm3/debitis-corrupti-quasi:

npm install @f1stnpm3/debitis-corrupti-quasi --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install @f1stnpm3/debitis-corrupti-quasi globally.

Usage

Add unused-imports to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
	"plugins": [<other_plugins_you_use>, "unused-imports"]
}

Then configure the rules you want to use under the rules section. I can recommend adding a check for underscores, e.g.

{
    "rules": {
        "no-unused-vars": "off", // or "@typescript-eslint/no-unused-vars": "off",
        "unused-imports/no-unused-imports": "error",
        "unused-imports/no-unused-vars": [
            "warn",
            {
                "vars": "all",
                "varsIgnorePattern": "^_",
                "args": "after-used",
                "argsIgnorePattern": "^_",
            },
        ],
    },
}

Supported Rules

  • no-unused-imports
  • no-unused-vars
testerpostcss-pluginreadableECMAScript 5valididlecloudfrontES7weakmappostcssBigUint64ArrayArray.prototype.filterinternal slotmatchAlllazyiterationES6containsisConcatSpreadablerfc4122mapreduceArray.prototype.flatMapprototypeRegExp.prototype.flagsshelltestingapidescriptorcjkstringifyeveryquotemrueast-asian-widthoptimizerescaperestless csstssignalsstatuselbrmarraybufferomitjapaneseflatairbnbgetintrinsicfoldertoSortedchinesefastcopytrimEndform-validationCSS0livelengthfpsparentnodecsscoerciblevestoptimistdependenciesremovergbebsreadablestreambyteOffsetcss lessmimetypedarraysfunctionsconsoledeterministiciamsymlinkseswafawaittostringtagArrayBuffer.prototype.slicejslook-upmodulecomputed-typesstructuredCloneviewglacieri18ninferenceMicrosoftReactiveExtensionsmomentcorsargumentcryptoelectronrm -frspinnertypedarrayargparsesnsdescriptioncreatelintcensorreal-timecloudformationfindLastIndexTypedArrayavacodeshardlinksrmdirlesstaprapidObservablepackage managerObject.getPrototypeOfreact-hook-formCSSStyleDeclarationrecursivevariables in csswhichcommandsearchdefinees-shim APIfigletbannernopeES2015typed arrayhotString.prototype.matchAllcommanderauthenticationtypescriptwatchirqECMAScript 2016collection.es6replayoffsetponyfillextendshamcryptstatelessES2023Uint32ArraysuperagentmacosregexStyleSheeteslintconfigcurlflagsreducermochaframeworksetterpreprocessoraccessibilitymkdiransibundlingutilitiesgroupmkdirpwebresolvezeroes2018libphonenumberconcatMaputilslotstyleguidequeueyupspeckoreanTypeBoxconfigurableprivate dataidaccessorworkerfsbootstrap cssfile system_.extendpositiveprivateglobcss-in-jsweaksetemrStreamspreserve-symlinkshelpersfindLastagentArrayArray.prototype.findLastiegetimportes2015busyjsdomthrottleamazontoStringTaguuidwidthfast-deep-copysafedayjsless.jscopyfastifyES2022prettyfunctioncomparestreamsES8wordwrapwrapURLES2017routeendpointpromisessigtermpropertiesstylingintrinsicvisualwalkingeslint-pluginobjectES2016immerPushforEachchromenativekinesiseventsregular expressionclassnamebrowserlistmatchesstatepredictablecolorsqs[[Prototype]]packagenodejspushhandlersfast-clonereactgroupByfull-widthmime-dbjsxmixinstypanionclassesvaluerobustbyteregularl10nspeedinternales6io-tsformatinstallmakemonorepoprototoArraytypesafedomextensionnegative zerovalidatebrowserslistconcurrencystarterstreams2simpledbplugincolourequalityObject.keyselmreusepatchsyntaxminimalnegativeECMAScript 2019bcryptarraysdirectorysequenceerror-handlingoperating-systeminputmetadatatestparsingparentstypeofvpcrateprotocol-buffersReflect.getPrototypeOffind-upWeakSetMapmatchpackageslastrm -rfconcatObject.isredux-toolkitindicatordynamodbcallbindregular expressionsexit-codettyUnderscorerdsgetOwnPropertyDescriptorclassnamessetPrototypeOfbindgettermkdirseventDispatcheruninstall.envObject.valuesrestfulrandomshimfastES2018walkloggertypejsoninstallerlimitedsameValueZerocode pointsWebSocketcloudsearchflatMapsinatragetPrototypeOfSetefficientredactlanguageInt32ArrayserializationECMAScript 7gradients csskeystrimLeftenvrangeerrorECMAScript 2018charactersrouternameJSON-Schemafast-copytapetc39symlinkhasjsonpathpassworddateconfigasciihasOwnPropertyES2020dotenvbluebirdrequireruntimedataes-shimsshebangserializeflagterminalassertnamesschemepropassignstyled-componentsstylecolumnsFunction.prototype.nameURLSearchParamssiginttslibArray.prototype.findLastIndexexecObject.definePropertyutilitycallbackstylesheetmodulesless mixinsUint16Arrayownoptionmake dircolumnauthoutputpersistentgetoptroutingwatchFileeventEmitterdeepclonepropertycallboundcss nestingunicodemoveArrayBufferextraarktypequerystringchaifixed-widthtouchstoragegatewayswfsharedestreetoolkitchannelreact-hookscall-bindbeanstalkassertionfastclonepyyamles7RegExp#flagsphonevaluesajaxwhatwgcharacterString.prototype.trimobjsesECMAScript 2022BigInt64ArrayqueryArray.prototype.flatreact-testing-libraryjasminees8hooksformartIteratordependency managerlockfileencryption
1.0.0

1 year ago