Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
38 changes: 0 additions & 38 deletions .eslintrc

This file was deleted.

78 changes: 78 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
ignorePatterns: ['node_modules', 'dist'],
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
modules: true,
},
},
globals: {
mParticle: true,
describe: true,
assert: true,
Should: true,
MockHttpServer: true,
it: true,
sinon: true,
const: true,
before: true,
beforeEach: true,
afterEach: true,
after: true,
Promise: true,
},
extends: [
// Recommended rules
'eslint:recommended',

// Turn off conflicting rules
'prettier',
],
plugins: ['@typescript-eslint', 'prettier'],
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-this-alias': 'off',
'require-await': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
},
{
files: ['*.js'],
parser: '@babel/eslint-parser',

rules: {
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false,
},
],
},
},
],
rules: {
'prettier/prettier': 'error',
'no-prototype-builtins': 'off',
'no-empty': 'warn',
'no-unused-vars': 'warn',
'no-useless-escape': 'off',
'no-var': 'warn',
},
};
5 changes: 1 addition & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ jobs:
- name: Lint with ESLint
run: npm run lint

- name: Lint with Prettier
run: npm run prettier

- name: Run Build IIFE
run: npm run build:iife

Expand Down Expand Up @@ -224,7 +221,7 @@ jobs:
- name: NPM install
uses: actions/setup-node@v3
with:
node-version: latest
node-version: latest

- name: Run NPM CI
run: npm ci
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
- name: Lint with ESLint
run: npm run lint

- name: Lint with Prettier
run: npm run prettier

- name: Run Build IIFE
run: npm run build:iife

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.15.0
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ test/stub/test-stub-bundle.js
snippet.min.js
test/lib
mparticle.js
test/
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 4
"trailingComma": "all",
"tabWidth": 4,
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"wix.vscode-import-cost",
"orta.vscode-jest"
]
}
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"typescript.preferences.importModuleSpecifier": "relative",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json5]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// prettier-plugin-eslint uses eslint to format, so vscode-eslint is the 'formatter'.
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.codeActionsOnSave.mode": "all",
"eslint.format.enable": true,
"jest.runMode": {
"type": "on-save",
"testFileOnly": true,
"coverage": true
},
}
57 changes: 57 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Web SDK Build Watch",
"command": "npm run watch",
"presentation": {
"reveal": "always",
"panel": "new",
"group": "Web SDK Watchers"
},
"runOptions": {
"runOn": "folderOpen"
},
"group": "build"
},
{
"type": "shell",
"label": "Web SDK Build Tests Watch",
"command": "npm run watch:tests",
"presentation": {
"reveal": "always",
"panel": "new",
"group": "Web SDK Watchers"
},
"runOptions": {
"runOn": "folderOpen"
},
"group": "build",
"problemMatcher": []
},
{
"type": "shell",
"label": "Web SDK Test Debug",
"command": "npm run test:debug",
"presentation": {
"reveal": "always",
"panel": "new",
"group": "Web SDK Watchers"
},
"runOptions": {
"runOn": "folderOpen"
},
"group": "build"
},
{
"label": "Web SDK Watchers",
"dependsOn": [
"Web SDK Build Watch",
"Web SDK Tests Watch",
"Web SDK Test Debug"
],
"dependsOrder": "sequence"
}
]
}
Loading
Loading