@mparticle/eslint-plugin
v1.0.2-beta.1
Published
Linting rules to adhere to your mParticle data plan
Downloads
26
Maintainers
Keywords
Readme
@mparticle/eslint-plugin
Data quality at mParticle begins with data planning and getting data ingestion right.
The mParticle ESLint plugin allows developers to lint their code based on their company's mParticle Data Plan.
Setup
- Download your company's
data plan
.- Log into your company's mParticle dashboard.
- Click on
Data Master
, thenPlans
, then select the plan you want lint against (this is typically your most recent data plan version) - Next to
Bulk Import
at the top right, click...
, then clickDownload Plan Version
and place this anywhere in your root directory. In this example, we'll pretend you have anmParticleConfig
folder at the root of your project. Save the data plan into themParticleConfig
folder.
- Create an
mp.config.json
file in the root of your project with the following:
{
"planningConfig": {
"dataPlanVersionFile": "./dataPlan.json" // can be absolute or relative path
}
}
- @mparticle/eslint-plugin has a dependency of ESLint and requires a proper .eslintrc file, which you can learn more about at ESLint's setup page.
- In your command line,
cd
to your project root and enter:
npm install @mparticle/eslint-plugin
- In your .eslintrc file, add the following lines:
"plugins": ["@mparticle/eslint-plugin"],
"extends": ["plugin:@mparticle/data-planning"]
If you follow the directions above, you should now be able to see when you are not properly sending events in that adhere to your data plan.
Note that if your path to your data plan is incorrect inside of your mp.config.json file, you'll see an error message wherever mParticle is called that says Your mParticle data plan was not found. Please be sure to reference your data plan properly in mp.config.json and try again.
If your company makes changes to your data plan, please repeat step 1, selecting the new data plan.
Core SDK Documentation
Fully detailed documentation and other information about mParticle web SDK can be found at our doc site
Contribution Guidelines
At mParticle, we are proud of our code and like to keep things open source. If you'd like to contribute, simply fork this repo, push any code changes to your fork, and submit a Pull Request against the master
branch of this repo.
Running the Tests
Prior to running the tests please install all dev dependencies via an npm install
. Then simply run npm run test
The test script will run all tests using Mocha as unit tests.
Support
License
The mParticle Web Media SDK is available under the Apache License, Version 2.0. See the LICENSE file for more info.