mirror of https://github.com/vector-im/riot-web
Correctly get the path of the js-sdk .eslintrc.js
So we work correctly when we're included in another modulepull/21833/head
parent
1e77b2eba3
commit
905508f1ce
11
.eslintrc.js
11
.eslintrc.js
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue