npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@toptal/eslint-plugin-davinci

v7.0.0

Published

davinci eslint rules

Readme

@toptal/eslint-plugin-davinci

Davinci eslint rules

Installation

Do not install this plugin directly. To configure your linter rules, use @toptal/davinci-syntax where all rules in this plugin are included.

Usage

Use it by installing pnpm add @toptal/davinci in your project.

Supported Rules

  • @toptal/davinci/consistent-component-props-types
  • @toptal/davinci/consistent-data-testid
  • @toptal/davinci/no-inline-css
  • @toptal/davinci/no-mock-export-from-index
  • @toptal/davinci/no-restricted-imports-monorepo
  • @toptal/davinci/no-restricted-imports-private
  • @toptal/davinci/no-denied-imports
  • @toptal/davinci/no-full-module-mock
  • @toptal/davinci/no-implicit-expectations
  • @toptal/davinci/no-jest-snapshot
  • @toptal/davinci/no-query-by-for-existence-assertions
  • @toptal/davinci/no-as-prop-for-css-styled-components
  • @toptal/davinci/no-forwarded-as-prop-for-non-styled-components
  • @toptal/davinci/no-deprecated-props
  • @toptal/davinci/no-package-self-imports
  • @toptal/davinci/consistent-template-literals-file
  • @toptal/davinci/consistent-changesets
  • @toptal/davinci/no-nested-typography-p

@toptal/davinci/no-restricted-imports-monorepo

The rule restricts the cross package imports in monorepos. This package uses micromatch lib to resolve glob expressions.

Usage:

{
  "extends": "./node_modules/@toptal/davinci-syntax/src/configs/.eslintrc",
  "rules": {
    "@toptal/davinci/no-restricted-imports-monorepo": [
      "error",
      [
        // lib can't depend on app
        {
          "from": "libs/**",
          "to": "namespaces/*/apps/**"
        },
        {
          "from": "apps/**",
          "to": "apps/**",
          "except": ["apps/app/**"]
        },
        {
          "from": "namespaces/*/libs/**",
          "to": "namespaces/*/apps/**"
        },
        // root-level lib can't depend on lib from the namespace
        {
          "from": "libs/**",
          "to": "namespaces/*/libs/**"
        },
        // app can't depend on app
        {
          "from": "namespaces/*/apps/**",
          "to": "namespaces/*/apps/**"
        },
        // host can't be imported anywhere
        {
          "from": "!hosts/**",
          "to": "hosts/**"
        },
        // namespaces/facilities/libs may depends only on namespaces/facilities/libs/ or libs/
        {
          "from": "namespaces/facilities/libs/**",
          "to": "namespaces/!(facilities)/libs/**"
        }
      ]
    ]
  }
}

@toptal/davinci/no-as-prop-for-css-styled-components

According to https://styled-components.com/docs/api#forwardedas-prop styled-components should use forwardedAs prop instead of as prop to proxy as prop value to the component.

Example:

import { Container } from '@toptal/picasso'

<Container css={S.style} forwardedAs='span'>
  ...
</Container>

@toptal/davinci/no-forwarded-as-prop-for-non-styled-components

Opposite to @toptal/davinci/no-as-prop-for-css-styled-components rule - for non styled components we should not use forwardedAs prop, because it will not make any effect on them. as prop should be used instead.

@toptal/davinci/no-deprecated-props

The rule restricts the usage of deprecated props from components.

Usage:

{
  "rules": {
    "@toptal/davinci/no-deprecated-props": [
      "error",
      [
        {
          "componentName": "Comp1",
          "deprecatedProps": [
            {
              "name": "propA",
              "message": "propA is deprecated."
            }
          ]
        }
      ]
    ]
  }
}

@toptal/davinci/no-package-self-imports

The rule disallow self-imports of the package in order to use relative import paths inside a module.

The rule accepts two options:

  • excludeFiles - array of glob whose files should skip validation
  • excludePaths - array of glob whose import paths should skip validation

This package uses micromatch lib to resolve glob expressions.

Usage:

{
  "extends": "./node_modules/@toptal/davinci-syntax/src/configs/.eslintrc",
  "rules": {
    "@toptal/davinci/no-package-self-imports": [
      "error",
      {
        "excludeFiles": ["**/*.test.tsx", "**/*.example.tsx"],
        "excludePaths": ["@toptal/picasso/test-utils", "@toptal/picasso/**"]
      }
    ]
  }
}

@toptal/davinci/consistent-template-literals-file

The rule validates the filename based in the expressions set for template literals.

The rule accepts two options:

  • templateMatchers - array of regex expressions whose will perform over all template literals in the file.
  • filenameMatcher - the regex that will validate the name of the file.

Usage:

{
  "extends": "./node_modules/@toptal/davinci-syntax/src/configs/.eslintrc",
  "rules": {
    "@toptal/davinci/consistent-template-literals-file": [
      "error",
      {
        "templateMatchers": ["@rest"],
        "filenameMatcher": "\.rest\.tsx?"
      }
    ]
  }
}

@toptal/davinci/consistent-changesets

This rule validates markdown files generated by Changeset.

The validation ensures files comply to FX's changeset guidelines

Usage:

{
  "overrides": [
    {
      "files": [".changeset/*.md"],
      "parser": "eslint-plugin-markdownlint/parser",
      "rules": {
        "@toptal/davinci/consistent-changesets": "error"
      }
    }
  ]
}

Dot-folder folders are ignored by default, so we need to update .eslintignore as well.

!.changeset
.changeset/README.md

@toptal/davinci/no-nested-typography-p

This rule prevents nesting Typography components in a way that would result in a <p> HTML element inside another <p> HTML element, which is invalid HTML. The Typography component defaults to rendering a <p> tag. This can be changed using the as or forwardedAs props. The rule checks the effective tag rendered by nested Typography components.

Example of incorrect code:

import { Typography } from '@toptal/picasso'

// Both Typography components will render as <p>
<Typography>
  <Typography>This is a nested paragraph, which is not allowed.</Typography>
</Typography>

// Explicitly setting 'as' or 'forwardedAs' to "p"
<Typography as="p">
  <Typography forwardedAs="p">Nested paragraph.</Typography>
</Typography>

Example of correct code:

import { Typography } from '@toptal/picasso'

// Inner Typography is changed to a <span>
<Typography>
  <Typography as="span">This is a nested span, which is allowed.</Typography>
</Typography>

// Outer Typography is changed to a <div>
<Typography as="div">
  <Typography>This is a paragraph inside a div.</Typography>
</Typography>

<Typography forwardedAs="div">
  <Typography as="span">Nested content.</Typography>
</Typography>