1.0.1 • Published 9 months ago

rocketseat-biomejs-config v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Rocketseat biomejs config

I use @rocketseat/eslint-config a lot, so I decided to create a Biome version since I'm planning to migrate to it.

There are still a few features missing. You can find the rules I was able to implement and those that Biome currently supports in the rules list below

I'll try to keep this updated as much as possible, but I might miss something occasionally, so feel free to open an issue - it would really help a lot!

Summary

How to use

First download the package as a dev dependency:

$ npm i -D rocketseat-biomejs-config

$ pnpm i -D rocketseat-biomejs-config

$ yarn add -D rocketseat-biomejs-config

$ bun add -d rocketseat-biomejs-config

Then create the file biome.json and add the following:

{
  "extends": ["rocketseat-biomejs-config/react|node|next"]
}

Rules list

Below you can see the rules I found that Rocketseat uses. It's mostly the plugin's recommended settings, with only a few exceptions.

Uses

Which configuration each technology uses:

Node:

  • standard
  • typescript-eslint/recommended

React:

  • react/recommended
  • react-hooks/recommended
  • standard
  • typescript-eslint/recommended

Next:

  • eslint-plugin-next
  • standard
  • typescript-eslint/recommended

Legend

  • ❌: if it should be an error
  • ⚠️: if it should be a warning
  • ⚫: if it should be off

standard/

  • no-var ⚠️
  • object-shorthand ❌, 'properties'
  • accessor-pairs
    • setWithoutGet: true
    • enforceForClassMembers: true
  • array-bracket-spacing ❌, 'never'
  • array-callback-return
    • allowImplicit: false
    • checkForEach: false
  • arrow-spacing
    • before: true
    • after: true
  • block-spacing ❌, 'always'
  • brace-style ❌, '1tbs'
    • allowSingleLine: true
  • camelcase
    • allow: ^UNSAFE_
    • properties: never
    • ignoreGlobals: true
  • comma-dangle
    • arrays: never
    • objects: never
    • imports: never
    • exports: never
    • functions: never
  • comma-spacing
    • before: false
    • after: true
  • comma-style ❌, 'last'
  • computed-property-spacing ❌, 'never'
    • enforceForClassMembers: true
  • constructor-super
  • curly ❌, 'multi-line'
  • default-case-last
  • dot-location ❌, 'property'
  • dot-notation
    • allowKeywords: true
  • eol-last
  • eqeqeq ❌, 'always'
    • null: 'ignore'
  • func-call-spacing ❌, 'never'
  • generator-star-spacing
    • before: true
    • after: true
  • indent ❌, 2
    • SwitchCase: 1,
    • VariableDeclarator: 1
    • outerIIFEBody: 1
    • MemberExpression: 1
    • FunctionDeclaration: {}
      • parameters: 1
      • body: 1
    • FunctionExpression: {}
      • parameters: 1
      • body: 1
    • CallExpression: {}
      • arguments: 1
    • ArrayExpression: 1
    • ObjectExpression: 1
    • ImportDeclaration: 1
    • flatTernaryExpressions: false
    • ignoreComments: false
    • ignoredNodes: []
      • 'TemplateLiteral *'
      • 'JSXElement'
      • 'JSXElement > *'
      • 'JSXAttribute'
      • 'JSXIdentifier'
      • 'JSXNamespacedName'
      • 'JSXMemberExpression'
      • 'JSXSpreadAttribute'
      • 'JSXExpressionContainer'
      • 'JSXOpeningElement'
      • 'JSXClosingElement'
      • 'JSXFragment'
      • 'JSXOpeningFragment'
      • 'JSXClosingFragment'
      • 'JSXText'
      • 'JSXEmptyExpression'
      • 'JSXSpreadChild'
    • offsetTernaryExpressions: true
  • key-spacing
    • beforeColon: false
    • afterColon: true
  • keyword-spacing
    • before: true
    • after: true
  • lines-between-class-members ❌, 'always'
    • exceptAfterSingleLine: true
  • multiline-ternary ❌, 'always-multiline'
  • new-cap
    • newIsCap: true
    • capIsNew: false
    • properties: true
  • new-parens
  • no-array-constructor
  • no-async-promise-executor
  • no-caller
  • no-case-declarations
  • no-class-assign
  • no-compare-neg-zero
  • no-cond-assign
  • no-const-assign
  • no-constant-condition
    • checkLoops: false
  • no-control-regex
  • no-debugger
  • no-delete-var
  • no-dupe-args
  • no-dupe-class-members
  • no-dupe-keys
  • no-duplicate-case
  • no-useless-backreference
  • no-empty
    • allowEmptyCatch: true
  • no-empty-character-class
  • no-empty-pattern
  • no-eval
  • no-ex-assign
  • no-extend-native
  • no-extra-bind
  • no-extra-boolean-cast
  • no-extra-parens ❌, 'functions'
  • no-fallthrough
  • no-floating-decimal
  • no-func-assign
  • no-global-assign
  • no-implied-eval
  • no-import-assign
  • no-invalid-regexp
  • no-irregular-whitespace
  • no-iterator
  • no-labels
  • no-lone-blocks
  • no-loss-of-precision
  • no-misleading-character-class
  • no-prototype-builtins
  • no-useless-catch
  • no-mixed-operators
  • no-mixed-spaces-and-tabs
  • no-multi-spaces
  • no-multi-str
  • no-multiple-empty-lines
    • max: 1
    • maxBOF: 0
    • maxEOF: 0
  • no-new
  • no-new-func
  • no-new-object
  • no-new-symbol
  • no-new-wrappers
  • no-obj-calls
  • no-octal
  • no-octal-escape
  • no-proto
  • no-redeclare
    • builtinGlobals: false
  • no-regex-spaces
  • no-return-assign ❌, 'except-parens'
  • no-self-assign
    • props: true
  • no-self-compare
  • no-sequences
  • no-shadow-restricted-names
  • no-sparse-arrays
  • no-tabs
  • no-template-curly-in-string
  • no-this-before-super
  • no-throw-literal
  • no-trailing-spaces
  • no-undef
  • no-undef-init
  • no-unexpected-multiline
  • no-unmodified-loop-condition
  • no-unneeded-ternary
    • defaultAssignment: false
  • no-unreachable
  • no-unreachable-loop
  • no-unsafe-finally
  • no-unsafe-negation
  • no-unused-expressions
    • allowShortCircuit: true
    • allowTernary: true
    • allowTaggedTemplates: true
  • no-unused-vars
    • args: 'none'
    • caughtErrors: 'none'
    • ignoreRestSiblings: true
    • vars: 'all'
  • no-use-before-define
    • functions: false
    • classes: false
    • variables: false
  • no-useless-call
  • no-useless-computed-key
  • no-useless-constructor
  • no-useless-escape
  • no-useless-rename
  • no-useless-return
  • no-void
  • no-whitespace-before-property
  • no-with
  • object-curly-newline
    • multiline: true
    • consistent: true
  • object-curly-spacing ❌, 'always'
  • object-property-newline
    • allowMultiplePropertiesPerLine: true
  • one-var
    • initialized: 'never'
  • operator-linebreak ❌, 'after'
    • overrides: {}
      • '?': 'before'
      • ':': 'before'
      • '|>': 'before'
  • padded-blocks
    • blocks: 'never'
    • switches: 'never'
    • classes: 'never'
  • prefer-const
    • destructuring: 'all'
  • prefer-promise-reject-errors
  • prefer-regex-literals
    • disallowRedundantWrapping: true
  • quote-props ❌, 'as-needed'
  • quotes ❌, 'single'
    • avoidEscape: true
    • allowTemplateLiterals: false
  • rest-spread-spacing ❌, 'never'
  • semi ❌, 'never'
  • semi-spacing
    • before: false
    • after: true
  • space-before-blocks ❌, 'always'
  • space-before-function-paren ❌, 'always'
  • space-in-parens ❌, 'never'
  • space-infix-ops
  • space-unary-ops
    • words: true
    • nonwords: false
  • spaced-comment ❌, 'always'
    • line: {}
      • markers: []
        • '*package'
        • '!'
        • '/'
        • ','
        • '='
    • block: {}
    • balanced: true
    • markers: []
      • '*package'
      • '!'
      • ','
      • ':'
      • '::'
      • 'flow-include'
    • exceptions: []
      • '*'
  • symbol-description
  • template-curly-spacing ❌, 'never'
  • template-tag-spacing ❌, 'never'
  • unicode-bom ❌, 'never'
  • use-isnan
    • enforceForSwitchCase: true
    • enforceForIndexOf: true
  • valid-typeof
    • requireStringLiterals: true
  • wrap-iife ❌, 'any'
    • functionPrototypeMethods: true
  • yield-star-spacing ❌, 'both'
  • yoda ❌, 'never'
  • import/export
  • import/first
  • import/no-absolute-path
    • esmodule: true
    • commonjs: true
    • amd: false
  • import/no-duplicates
  • import/no-named-default
  • import/no-webpack-loader-syntax
  • n/handle-callback-err ❌, '^(err|error)$'
  • n/no-callback-literal
  • n/no-deprecated-api
  • n/no-exports-assign
  • n/no-new-require
  • n/no-path-concat
  • n/process-exit-as-throw
  • promise/param-names

typescript-eslint/

  • ban-ts-comment
  • no-array-constructor
  • no-duplicate-enum-values
  • no-empty-object-type
  • no-explicit-any
  • no-extra-non-null-assertion
  • no-misused-new
  • no-namespace
  • no-non-null-asserted-optional-chain
  • no-require-imports
  • no-this-alias
  • no-unnecessary-type-constraint
  • no-unsafe-declaration-merging
  • no-unsafe-function-type
  • no-unused-expressions
  • no-unused-vars
  • no-wrapper-object-types
  • prefer-as-const
  • prefer-namespace-keyword
  • triple-slash-reference

react/

  • display-name ?
  • jsx-key ?
  • jsx-no-comment-textnodes ?
  • jsx-no-duplicate-props ?
  • jsx-no-target-blank ?
  • jsx-no-undef ?
  • jsx-uses-react ?
  • jsx-uses-vars ?
  • no-children-prop ?
  • no-danger-with-children ?
  • no-deprecated ?
  • no-direct-mutation-state ?
  • no-find-dom-node ?
  • no-is-mounted ?
  • no-render-return-value ?
  • no-string-refs ?
  • no-unescaped-entities ?
  • no-unknown-property
  • prop-types
  • react-in-jsx-scope
  • require-render-return ?
  • self-closing-comp

react-hooks/

  • rules-of-hooks
  • exhaustive-deps

jsx-a11y/

  • alt-text ⚠️
    • elements: []
      • img
    • img: []
      • 'Image'
  • aria-props ⚠️
  • aria-proptypes ⚠️
  • aria-unsupported-elements ⚠️
  • role-has-required-aria-props ⚠️
  • role-supports-aria-props ⚠️

eslint-plugin-next/

  • google-font-display
  • google-font-preconnect
  • inline-script-id
  • next-script-ga
  • no-assign-module-variable
  • no-async-client-component
  • no-before-interactive-script-outside-document
  • no-css-tags
  • no-document-import-in-page
  • no-duplicate-head
  • no-head-element
  • no-head-import-in-document
  • no-html-link-for-pages
  • no-img-element
  • no-page-custom-font
  • no-script-component-in-head
  • no-styled-jsx-in-document
  • no-sync-scripts
  • no-title-in-document-head
  • no-typos
  • no-unwanted-polyfillio

Reference

1.0.1

9 months ago

1.0.0

9 months ago