1.0.0 • Published 16 days ago

@landmineaknpm/soluta-adipisci-nobis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

eslint-define-config

Provide a defineConfig function for .eslintrc.js, and a defineFlatConfig function for eslint.config.js files.

Installation

# add eslint and eslint-define-config to project’s dev dependencies
npm add --save-dev eslint eslint-define-config
# or
yarn add --dev eslint eslint-define-config
# or
pnpm add --save-dev eslint eslint-define-config

Usage

By default only eslint's rules are supported. To activate auto-suggestions for Rules of specific plugins, you need to install the respective types for that plugin.
Plugins can either support their own types, or they could be supported by the community in the @eslint-types repository.

A list of community supported plugins can be found here.

.eslintrc.js

// @ts-check
const { defineConfig } = require('eslint-define-config');

/// <reference types="@eslint-types/typescript-eslint" />

module.exports = defineConfig({
  root: true,
  rules: {
    // rules...
  },
});

Flat Config

eslint.config.js

// @ts-check
const { defineFlatConfig } = require('eslint-define-config');

/// <reference types="@eslint-types/typescript-eslint" />

module.exports = defineFlatConfig([
  'eslint:recommended',
  {
    plugins: {
      // plugins...
    },
    rules: {
      // rules...
    },
  },
]);

Why?

Improve your eslint configuration experience with:

  • auto-suggestions
  • type checking (Use // @ts-check at the first line in your .eslintrc.js or eslint.config.js)
  • documentation
  • deprecation warnings

Video

Click on the thumbnail to play the video

Want to support your own plugin?

:warning: This feature is very new and requires the support of the respective plugin owners

Add a declare module to your plugin package like this:

declare module 'eslint-define-config' {
  export interface CustomRuleOptions {
    /**
     * Require consistently using either `T[]` or `Array<T>` for arrays.
     *
     * @see [array-type](https://typescript-eslint.io/rules/array-type)
     */
    '@typescript-eslint/array-type': [
      {
        default?: 'array' | 'generic' | 'array-simple';
        readonly?: 'array' | 'generic' | 'array-simple';
      },
    ];

    // ... more Rules
  }
}

There are other interfaces that can be extended.

  • CustomExtends
  • CustomParserOptions
  • CustomParsers
  • CustomPlugins
  • CustomSettings

Credits

env__proto__classesfindupsettingsIteratorprivate dataguidUnderscoreESnextposejavascriptvalidatorcontainscss lessassignconsoleES2019structuredCloneshrinkwrapwritableformatvisualxssnoderegexpassertionttysyntaxrangeerrorsidespinnersprocessfast-deep-cloneclassnamecallbindcharactersuperagentless cssparseres2018callbackxhrArraytypedobjpatchgenericsrfc4122propertymakeutilitiesstarterpropfantasy-landObjectyupstringifyECMAScript 6css variablenumberweaksetdirSetgetintrinsicsameValueZerologgingWeakSetlessruntimeutil.inspectkeystyleindicatorbddwordwrapchromiumTypeScriptArrayBufferfromwidthtscensorxtermisConcatSpreadableupRegExp#flagsbuffersdeep-clonewatchFilebundlerequalitypropertiesoptimistrandomhardlinksfindLastidleapiObject.fromEntriesRFC-6455regularcopywalksignalsArrayBuffer#sliceparentES2015real-timepnpm9testerdataViewreduxfullphoneassertsserializerBigUint64Arraycommandbluebirdclicoremobilesanitizationtraverseworkspace:*lastcoerciblehashtranspilerpurerequirelesscssRxJSwgetmocharedux-toolkitfast-deep-copywebmatchflagsMicrosoftArray.prototype.filtercolumnchromekoreanfunctionhttpcall-bindes7iteratesetPrototypeOffind-upES8getOwnPropertyDescriptormomentES2020fast-copy6to5negativeFunction.prototype.namecolorsless.jsmergefseventsserializationspringcorsbabel-coregraphqlponyfillvestJSON3dlinkcjktostringtagesrapidfunctionswordbreakmrues-shim APIlimites5streams2compile lessremoveutility256schemamapconcatirqemitlimitedexitprogressiterationcommand-lineshelltaskconnectgroupByPromisetranspilestatelessbyteLengthspinnerminimalzerosymlinkbootstrap lessStyleSheetglobhooksunicodedropsanitizetddbindobjectserializeargumentgetterECMAScript 2018operating-systeminstallerbundlingstringregexJSON-SchemaRegExp.prototype.flagsschemelockfilecharactersio-tspolyfillInt32ArrayURLSearchParamsdescriptioncommanderfilterpathless compilersetImmediateregular expressions.envpromisefigletutilsajaxrequesttelephonees2017cryptvaluecallbounditeratortoStringTagdatatypanionconstjsonschemaredactfolderhttpsnodejsstdlibstyled-componentsescapeavaarrayes-shimsentriesqueryestreevalidationansieslint-pluginreadablestreamencryptionUint16Arrayeveryemojipreprocessorbannerawesomesauceuser-streamsyamltrimRightdependency managerutilstablearthandlersjsonpathjwtrm -rftypedarrayReactiveExtensionsexpressvaluesinternal slotweakmapworkerframerObject.entriesprefixenumerableeventsgradients css3qsString.prototype.matchAlltypesafereact-hooksReactiveXless mixinsgroupflatMapwatchingwatchpositivescheme-validationvariables in cssinvarianttoArraymulti-packagenameECMAScript 2015urlpoint-freegradients csses8ES5definemodulespicomatchmodulelinewrapfull-widthmake dirfsajvReflect.getPrototypeOfdataviewfunctionalgetoptawaitsymbolconsumemimeMapwarningwhatwgnamesECMAScript 2022forEachcodesUint8ClampedArraywaapiboundreadfastfast-cloneES7tc39toolkitdependenciestrimLeftdefinePropertydebuggerwindowsprototypeconcurrencyoptimizerECMAScript 2017Array.prototype.findLastIndextakeparentsWeakMappackage managerprunewritehookformwaitslicebrowserlistdatastructuretslibrm -frpyyamlimportprotocol-bufferstacitpopmotionmixinsObject.assignObservablesinternalvalidatestylingbcryptcode pointscall-boundeslintconfigvariables_.extendsafeObject.definePropertylazycomputed-typessigtermtimeterminalefficientStreambrowserURLtrimStartlanguagekarmaYAMLreadablelistenersECMAScript 2023ECMAScript 2016jasminefile systemArray.prototype.findLastloggeres2015i18nslotoncelrunopejoishimjson-schemaECMAScript 5touchdeepcopyrmdirincludesautoprefixerarktypedom-testing-libraryjQueryObservableeslintwatcherqueueMicrotaskcallhelpers-0stringifierimmergetPrototypeOfHyBiconfigurabletypeerrorregular expressionformattingwraplintasynccolumnsextensionthrottlefetchshebangextenddeepclonea11ytrimelectronexecCSSStyleDeclarationObject.valuesnegative zerodescriptorendercheckFloat64ArrayWebSocketmatchesECMAScript 2020busybabeltesting
1.0.0

16 days ago