-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add eslint configuration and fix linting issues
- Loading branch information
Showing
14 changed files
with
1,263 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"es2020": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "commonjs" | ||
}, | ||
"rules": { | ||
"no-unused-vars": ["error", { | ||
/* | ||
* The \^[A-Z][a-z]+\ pattern is intended to allow the importing of constructor functions (a.k.a classes) | ||
* for the sole purpose of using them in JSDoc type annotations. Without this, eslint | ||
* would complain, because it doesn't recognize usage in JSDoc comments as actual usage. | ||
*/ | ||
"varsIgnorePattern": "^[A-Z][a-z]+|^_", | ||
"argsIgnorePattern": "^_", | ||
"caughtErrorsIgnorePattern": "^_" | ||
}] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["src/**/*.js"], | ||
"env": { | ||
"browser": true | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"globals": { | ||
"chrome": "readonly", | ||
"WEBPACK_MODE": "readonly" | ||
} | ||
}, | ||
{ | ||
"files": ["tests/**/*.js"], | ||
"env": { | ||
"jest": true | ||
}, | ||
"parserOptions": { | ||
"sourceType": "commonjs" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare var WEBPACK_MODE: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// eslint-disable-next-line no-undef | ||
module.exports = { | ||
testMatch: ["<rootDir>/tests/**/*.test.js"], | ||
// moduleNameMapper: { | ||
// "^src/(.*)": "<rootDir>/src/$1" | ||
// } | ||
}; | ||
moduleNameMapper: { | ||
"^src/(.*)": "<rootDir>/src/$1" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.