eslint-plugin-powerbi-visuals
Advanced tools
Comparing version
{ | ||
"name": "eslint-plugin-powerbi-visuals", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "ESLint rules and extensions for Power BI Visuals projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,4 +1,4 @@ | ||
# Microsoft Power BI Custom Visuals ESLint Plugin | ||
[](https://www.npmjs.com/package/eslint-plugin-powerbi-visuals) [](https://www.npmjs.com/package/eslint-plugin-powerbi-visuals) | ||
# Contributing | ||
This project welcomes contributions and suggestions. Most contributions require you to agree to a | ||
@@ -15,1 +15,58 @@ Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us | ||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. | ||
# How To Use | ||
1. Install ES Lint packages | ||
```javascript | ||
npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin --saveDev | ||
``` | ||
2. Install `eslint-plugin-pbivisuals` package | ||
```javascript | ||
npm install eslint-plugin-powerbi-visuals --saveDev | ||
``` | ||
3. Create `.eslintrc.js` file with the following content | ||
```javascript | ||
module.exports = { | ||
env: { | ||
"browser": true, | ||
"es6": true, | ||
"es2017": true | ||
}, | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "tsconfig.json", | ||
tsconfigRootDir: ".", | ||
}, | ||
plugins: [ | ||
"powerbi-visuals" | ||
], | ||
extends: [ | ||
"plugin:powerbi-visuals/recommended" | ||
], | ||
rules: {} | ||
}; | ||
``` | ||
4. Create `.eslintignore` file with the following content | ||
```javascript | ||
node_modules | ||
dist | ||
coverage | ||
test | ||
.eslintrc.js | ||
karma.conf.ts | ||
test.webpack.config.js | ||
``` | ||
5. Add a script into `package.json` | ||
```javascript | ||
"eslint": "npx eslint . --ext .js,.jsx,.ts,.tsx" | ||
``` | ||
6. Run linter | ||
```javascript | ||
npm run eslint | ||
``` |
20248
7.18%72
380%