Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-tidal

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-tidal

ESLint sharable flat config for TIDAL

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34
decreased by-63.44%
Maintainers
0
Weekly downloads
 
Created
Source

eslint-config-tidal

NPM downloads NPM version

ESLint shareable config for the TIDAL web frontend code style using the new flat config format.

Usage

We export one ESLint configuration for your usage (including Prettier for formatting).

Install the package as a devDependency: eslint-config-tidal along with eslint (and possible any plugins/configs that should be project specific).

Add a root eslint.config.js file, similar to this:

import tidal from 'eslint-config-tidal';

/** @type { import("eslint").Linter.Config[] } */
export default [
  ...tidal,
  {
    files: ['*.js', '**/*.js', '**/*.ts', '**/*.tsx'],
  },
  {
    ignores: [
      'node_modules/*',
      /* Build output folders, etc */
    ],
  },
  /* Add any overrides here */
];

For running from a shell you can add an entry in package.jsons scripts like this:

"lint:code": "eslint . --cache --cache-strategy content",

(which will also cache results, so re-runs are faster)

This depends on your package.json including "type": "module". If that is not possible, you can work around that by renaming your eslint.config.js to: eslint.config.mjs and launching it like this instead: ESLINT_USE_FLAT_CONFIG=true eslint . --config eslint.config.mjs. This means you will need to update any scripts that use eslint to be called this way though, like lint-staged and IDE integration (currently not possible for Webstorm: https://youtrack.jetbrains.com/issue/WEB-61117).

VSCode setup

Install the plugin: dbaeumer.vscode-eslint

And then ensure you have this in your workspace or user settings:

  "[javascript][typescript][typescriptreact][json]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "eslint.useFlatConfig": true

(This will auto-fix and auto format the files on save.)

PS: If you needed the workaround for not using "type": "module" above, you will also need:

"eslint.options": {
    "overrideConfigFile": "eslint.config.mjs"
  }

Philosophy

This package is pretty opinionated, if some rules are not suitable in your context they can be disable in your eslint.config.js or set to warnings instead of errors, if it makes sense to push for them eventually.

In this package however rules should (ideally) either be "error" or "off".

Development:

In the package you want to lint: (assuming it is in a sibling folder) yarn link ../eslint-config-tidal

Updating dependencies:

Normally handled by Renovate, but if you want to do it manually: npx npm-check-updates --interactive --format group

Publishing

Done locally for now (using npm publish).

Keywords

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc