Merge pull request #640 from matrix-org/dbkr/eslint_find_extend_module

Correctly get the path of the js-sdk .eslintrc.js
pull/21833/head
Richard van der Hoff 2017-01-24 11:34:28 +00:00 committed by GitHub
commit e18a6151e4
1 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,15 @@
const path = require('path');
// get the path of the js-sdk so we can extend the config
// eslint supports loading extended configs by module,
// but only if they come from a module that starts with eslint-config-
// So we load the filename directly (and it could be in node_modules/
// or or ../node_modules/ etc)
const matrixJsSdkPath = path.dirname(require.resolve('matrix-js-sdk'));
module.exports = {
parser: "babel-eslint",
extends: ["./node_modules/matrix-js-sdk/.eslintrc.js"],
extends: [matrixJsSdkPath + "/.eslintrc.js"],
plugins: [
"react",
"flowtype",