1.0.3 • Published 1 year ago

eslint-plugin-crx-v3 v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

eslint-plugin-crx-v3

Detect the v3 version of Chrome Extension

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-crx-v3:

npm install eslint-plugin-crx-v3 --save-dev

Usage

Configuration (eslint.config.js)

Use eslint.config.js file to configure rules. This is the default in ESLint v9, but can be used starting from ESLint v8.57.0. See also: https://eslint.org/docs/latest/use/configure/configuration-files-new

Example eslint.config.js

import eslintPluginCrxV3 from 'eslint-plugin-crx-v3'

export default [
  ...eslintPluginCrxV3.configs['flat/recommended'],
  {
    rules: {
        // override/add rules settings here, such as:
        // 'crx-v3/api-calls': 'warn'
    }
  }
]

Configuration (.eslintrc)

Use .eslintrc.* file to configure rules in ESLint < v9. See also: https://eslint.org/docs/latest/use/configure/.

Example .eslintrc.js:

module.exports = {
  extends: [
    // add more generic rulesets here, such as:
    // 'eslint:recommended',
    'plugin:crx-v3/recommended'
  ],
  rules: {
    // override/add rules settings here, such as:
    // 'crx-v3/api-calls': 'warn'
  }
}

tips

You need to explicitly include the JSON file when use Eslint to lint your project

Example package.json

"scripts": {
    "lint": "eslint . --ext .js,.json"
  },

Rules

šŸ’¼ Configurations enabled in.\ āœ… Set in the recommended configuration.\ šŸ”§ Automatically fixable by the --fix CLI option.

NameDescriptionšŸ’¼šŸ”§
api-callsCheck if API calls comply with v3 requirementsāœ…
check-manifestcheck crx menifest.json for v3āœ…šŸ”§
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.2

1 year ago

1.0.0-beta.1

1 year ago