Skip to content

JS / TS Support #40

Answered by schoero
blowsie asked this question in Q&A
Discussion options

You must be logged in to vote

For a JavaScript file, no special parsers are necessary. The only thing necessary is to include the plugin and the rules in your eslint config:

// eslint.config.js

import eslintPluginReadableTailwind from "eslint-plugin-readable-tailwind";

export default [
  {
    plugins: {
      "readable-tailwind": eslintPluginReadableTailwind
    },
    rules: {
      ...eslintPluginReadableTailwind.configs.warning.rules,
    }
  }
];

For TypeScript files, the @typescript-eslint/parser is actually necessary.

// eslint.config.js

import eslintPluginReadableTailwind from "eslint-plugin-readable-tailwind"
import eslintParserTypeScript from "@typescript-eslint/parser"

export default [
  {
    languageO…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by blowsie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants