I use webpack plugin:
new webpack.DefinePlugin({
PUBLIC_KEY:'\'XXX\'',
CLIENT_ID: '\'XXXX\''
})
tgc.init({
publicKey: PUBLIC_KEY,
clientId: CLIENT_ID
});
I use eslint and use Disallow Undeclared Variables (no-undef)
rule, so when I write
tgc.init({
publicKey: PUBLIC_KEY,
clientId: CLIENT_ID
});
I get errors:
'PUBLIC_KEY' is not defined
'CLIENT_ID' is not edfined
How to avoid it? I don't want to disable this rule (with disabled rule all works fine)
Add:
to your
eslint.rc
-file.or you can do the same in your webpack config -file as an inline comment like: