@mewjs/mpxml-eslint-parser
v1.0.3
Published
The ESLint custom parser for `.wxml`, `.axml`, `.swan` files.
Readme
mpxml-eslint-parser
The ESLint custom parser for .wxml, .axml, .swan files.
The .wxs files will be parsed as js files, see parserOptions.
Inspire from vue-eslint-parser.
💿 Install
npm install --save-dev eslint @mewjs/mpxml-eslint-parser- Requires Node.js 12 or later.
- Requires ESLint 7.0.0 or later.
- Requires
babel-eslint10.1.0 or later if you want it. (optional) - Requires
@typescript-eslint/parser2.31 or later if you want it. (optional)
📖 Usage
- Write
parseroption into your.eslintrc.*file. - Use glob patterns or
--ext .wxmlCLI option.
{
"extends": "eslint:recommended",
"parser": "@mewjs/mpxml-eslint-parser"
}$ eslint "src/**/*.{js,wxml,axml,swan,wxs}"
# or
$ eslint src --ext .wxml --ext .axml --ext .swan --ext .wxs🔧 Options
parserOptions has the same type as espree, the default parser of ESLint, is supporting.
For example:
{
"parser": "@mewjs/mpxml-eslint-parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"ecmaFeatures": {
"globalReturn": false,
"impliedStrict": false,
"jsx": false
}
}
}🍻 Contributing
Welcome contributing!
If you want to write code, please execute npm install && npm run setup after you cloned this repository.
The npm install command installs dependencies.
The npm run setup command initializes ESLint as git submodules for tests.
Development Tools
npm testruns tests and measures coverage.npm run buildcompiles TypeScript source code toindex.js,index.js.map, andindex.d.ts.npm run coverageshows the coverage result ofnpm testcommand with the default browser.npm run cleanremoves the temporary files which are created bynpm testandnpm run build.npm run lintruns ESLint.npm run setupsetups submodules to develop.npm run watchrunsbuild,update-fixtures, and tests with--watchoption.
