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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jamtastic/directus-standardish

v0.9.0

Published

Shareable code standards for Directus extensions

Downloads

1

Readme

Directus Code Standard ish

Shareable linting configuration for Directus extension projects. Designed to follow standards used in the official project with some potentially controversial caveats (ergo, "-ish"):

  1. No semi-colons 🫰[^dyslexic]

  2. Tabs Spaces 😄[^dyslexic]

  3. The following @typescript/* rules are re-enabled or changed[^typescript]:

    • no-explicit-any
    • no-var-require
    • no-non-null-assertion is set to "warn" (planned to set to error)
    • ban-ts-comment
  4. Prettier print width is set to 100 since eslint will handle the absolute max width (lines of code really should not go past 100 characters, and especially not 120)

  5. Vue files have their <script> and <style> tags indented to match the <template> tags[^dyslexic]

  6. Markdown prose no longer forcibly wraps (uses default value of "preserve") - use your editors wrap features as forced wrapping is error prone

  7. Addition of more rules that are currently undefined. They will be changed if the Directus project sets any of these rules.

[^typescript]: The Directus project already has these marked as for review and may eventually be the same as in this project anyway. Hopefully this is just getting ahead. [^dyslexic]: The primary contributor to this project is slightly dyslexic and these settings help them greatly.

Divider

Installation

Install the package in your Directus project:

$ npm install -D @jamtastic/directus-standardish

Configure your editor

Note: These instructions are VSCode specific.

Install the following extensions:

Add the following to your .vscode/settings.json file in your project:

{
  "stylelint.validate": ["css", "less", "postcss", "vue"],
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
  },
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  }
}

Divider

Usage

Note: This process is done automatically for new extensions in @jamtastic/directus when using the bunny new CLI command.

Add the following to your projects package.json file:

{
  "scripts": {
    "fix": "npm run fix:code && npm run fix:code && npm run fix:style",
    "fix:code": "eslint",
    "fix:format": "prettier",
    "fix:style": "stylelint **/*.{vue,css,scss,sass}",
    "lint": "npm run lint:code && npm run lint:code && npm run lint:style",
    "lint:code": "eslint",
    "lint:format": "prettier",
    "lint:style": "stylelint **/*.{vue,css,scss,sass}"
  },

  // ...

  "eslintConfig": {
    "extends": "@jamtastic/eslint-config-directus"
  },
  "prettier": "@jamtastic/directus-standardish/prettier",
  "stylelint": {
    "extends": "@jamtastic/directus-standardish/stylelint"
  }
}

Other options

Using package.json is the recommended way to use these config files however you may also extend the configuration by following the docs for each linting tool.

Stylelint (in a .stylelintrc file):

extends:
  - 'jamtastic/directus-standardish/stylelint'
rules: // your overrides here