Keegan-y / eslint-config

Shared @eslint configs for web development projects of @fastcms.

Home Page:https://npm.im/@fastcms/eslint-config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@fastcms/eslint-config

npm (scoped) David GitHub GitHub CI Workflow GitHub CodeQL Workflow

Shared @eslint configs for web development projects of @fastcms.

This shared ESLint config is extended from both airbnb and prettier styles, it also can be used for monorepo project.

Install

Use npx to install peerdeps automatically or install peerDependencies and optionalDependencies with npm/yarn manually.

# Install using npm
$ npm info "@fastcms/eslint-config" peerDependencies optionalDependencies
$ npx install-peerdeps --dev @fastcms/eslint-config

# Install using yarn
$ yarn add --dev @fastcms/eslint-config
$ yarn add --dev @babel/core eslint prettier typescript babel-plugin-module-resolver

Usage

After installation, add following contents to your .eslintrc or the eslintConfig entry of package.json file.

Monorepo (default)

{
  "extends": ["@fastcms"],
  "settings": {
    "polyfills": ["fetch", "Promise", "URL"]
  }
}

Added markdown and testing presets automatically.

JavaScript only project

{
  "extends": ["@fastcms/eslint-config/base"]
}

JavaScript only project (with jsx)

{
  "extends": ["@fastcms/eslint-config/react"]
}

TypeScript only project

{
  "extends": ["@fastcms/eslint-config/typescript"]
}

TypeScript only project (with tsx)

{
  "extends": ["@fastcms/eslint-config/typescript-react"]
}

Markdown only project (with mdx)

{
  "extends": ["@fastcms/eslint-config/markdown"]
}

Testing only project (with jsx/tsx)

{
  "extends": ["@fastcms/eslint-config/testing"]
}

TODO

  • bug: mdx with external react components parse error
  • feat: fenced codeblock in markdown should support ts and tsx
  • feat: add more typescript rules (refer to eslint-config-airbnb-typescript)
  • test: add more tests for ESLint rules
  • ci: integrate repo with GitHub Actions

License

The scripts and documentation in this project are released under the MIT License

About

Shared @eslint configs for web development projects of @fastcms.

https://npm.im/@fastcms/eslint-config

License:MIT License


Languages

Language:JavaScript 79.9%Language:TypeScript 19.9%Language:Shell 0.2%