BedrockStreaming / eslint-tools

BedrockStreaming's ESLint packages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-tools

This monorepo aims to mutualize the ESLint and Prettier configurations used in all Bedrock Streaming projects.

Migrating to version 4

The version 4 of eslint-tools introduces two importants structural changes:

  • From plugin to config

    Because @bedrockstreaming/eslint-plugin-react and @bedrockstreaming/eslint-plugin-vue are just ESLint configuration and don't bring any plugin's feature (like creating rules), these two packages will be renamed as respectively @bedrockstreaming/eslint-config-react and @bedrockstreaming/eslint-config-vue.

    It actually doesn't imply a lot of stuff except changing the way to extend these packages in the local ESLint configuration the following way:

     {
    -  "extends": "plugin:@bedrockstreaming/eslint-config-react/default"
    +  "extends": "@bedrockstreaming/eslint-config-react"
     }

    Or using the shorthand way:

     {
    -  "extends": "plugin:@bedrockstreaming/eslint-config-react/default"
    +  "extends": "@bedrockstreaming/react"
     }
  • From M6 WEB to Bedrock Streaming

    In the wake of renaming stuff from "m6web" to "bedrock streaming", the packages are now available under the NPM scope @bedrockstreaming instead of @m6web. So...

    @m6web/eslint-config becomes @bedrockstreaming/eslint-config
    @m6web/eslint-plugin-react becomes @bedrockstreaming/eslint-config-react
    @m6web/eslint-plugin-vue becomes @bedrockstreaming/eslint-config-vue

    Note that the version 3.5.0 previously available through @m6web scope will also be available through @bedrockstreaming allowing people changing without moving to version 4.

Contributing

Installing

Clone the repository and install dependencies:

$ yarn install

Testing

To test your changes there are two ways:

  • You can execute the eslint command in one of the folders under the ./tests directory.

    For instance, if you've made changes in the eslint-config-react package, execute the following command:

    $ yarn eslint tests/react
    

    Because eslint-tools uses for itself the configuration defined in the packages, you can simply launch the command yarn lint which will run ESLint on the whole project's files.

    If you need a concrete use case of a rule you set don't hesitate to update files in the ./tests directory as needed.

  • You can publish your changes in a NPM's pre-version.

    Note that you'll have to access to the @bedrockstreaming organization for that. Please contact the maintainers before..

    To do that, start by committing your changes on your branch (you won't have to push them) and execute the following command:

    $ yarn lerna publish --no-push <pre-version>
    

    Example:

    $ yarn lerna publish --no-push v4.3.0-beta.1
    

    The --no-push option allows you to publish the pre-version without pushing anything. Lerna creates a "bumping" commit that changes versions contained in files like package.json or lerna.json. You can remove that commit before continuing.

Publishing

In order to publish, owners of this repository can trigger the release Github action workflow. It will automatically check commit from master branch if you follow conventional commit names. Changelog will be published on a Github Release. It will also publish all the code directly to NPM.

About

BedrockStreaming's ESLint packages


Languages

Language:TypeScript 35.9%Language:JavaScript 31.6%Language:Vue 30.7%Language:SCSS 1.4%Language:Shell 0.4%