mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Disallow all anonymous default export, aside from CSF and migrations (#8535)
CSF = Storybook’s Component Story Format (CSF) See https://storybook.js.org/docs/formats/component-story-format/ Note that the migrations still use CommonJS require, so the default export as an object is quite ergonomic (& I don't want to touch the migrations).
This commit is contained in:
parent
3244449ab9
commit
e4b8cddf02
12
.eslintrc.js
12
.eslintrc.js
@ -50,7 +50,7 @@ module.exports = {
|
||||
'import/newline-after-import': 'error',
|
||||
'import/no-absolute-path': 'error',
|
||||
'import/no-amd': 'error',
|
||||
'import/no-anonymous-default-export': ['error', { 'allowObject': true }],
|
||||
'import/no-anonymous-default-export': 'error',
|
||||
'import/no-duplicates': 'error',
|
||||
'import/no-dynamic-require': 'error',
|
||||
'import/no-mutable-exports': 'error',
|
||||
@ -92,6 +92,16 @@ module.exports = {
|
||||
'mocha/no-setup-in-describe': 'off',
|
||||
},
|
||||
|
||||
overrides: [{
|
||||
files: [
|
||||
'app/scripts/migrations/*.js',
|
||||
'*.stories.js',
|
||||
],
|
||||
rules: {
|
||||
'import/no-anonymous-default-export': ['error', { 'allowObject': true }],
|
||||
},
|
||||
}],
|
||||
|
||||
settings: {
|
||||
'react': {
|
||||
'version': 'detect',
|
||||
|
@ -2,7 +2,7 @@ const mockHex = '0xabcdef0123456789'
|
||||
const mockKey = Buffer.alloc(32)
|
||||
let cacheVal
|
||||
|
||||
export default {
|
||||
const mockEncryptor = {
|
||||
|
||||
encrypt (_, dataObj) {
|
||||
cacheVal = dataObj
|
||||
@ -34,3 +34,5 @@ export default {
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export default mockEncryptor
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default {
|
||||
const state = {
|
||||
'metamask': {
|
||||
'isInitialized': true,
|
||||
'isUnlocked': true,
|
||||
@ -218,3 +218,5 @@ export default {
|
||||
'errors': { 'someError': null },
|
||||
},
|
||||
}
|
||||
|
||||
export default state
|
||||
|
Loading…
Reference in New Issue
Block a user