eslint-plugin-wxml
v0.8.0
Published
eslint plugin for wxml
Downloads
72
Maintainers
Readme
An ESLint plugin to lint wxml files.
Show Case
Installation
## npm
$ npm install eslint-plugin-wxml --save-dev
## cnpm (for china user)
$ cnpm install eslint-plugin-wxml --save-dev
## pnpm
$ pnpm add eslint-plugin-wxml -D
## yarn
$ yarn add eslint-plugin-wxml -D
Basic Usage
Configuration (eslint.config.mjs
)
Use eslint.config.mjs
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.mjs:
import wxml from "eslint-plugin-wxml";
import wxmlParser from "@wxml/parser";
export default [
{
files: ["**/*.wxml"],
plugins: {
wxml: wxml,
},
languageOptions: {
parser: wxmlParser,
},
rules: {
"wxml/report-wxml-syntax-error": "error",
},
},
];
Configuration (.eslintrc
)
Use .eslintrc.*
file to configure rules. See also: https://eslint.org/docs/v8.x/use/configure/configuration-files.
+ "overrides": [
+ {
+ "files": ["*.wxml"],
+ "rules": {
+ "wxml/report-wxml-syntax-error": "error"
+ },
+ "plugins": ["wxml"],
+ "processor": "wxml/wxml",
+ "parser": "@wxml/parser"
+ }
+ ],
Missing Rule
Missing your wanted rule ? please report it as a new github issue, thanks !
Documentation
License
Copyright (c) 2021-present, Lei Chen