forked from RedHatInsights/vulnerability-ui
-
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.
chore: Use eslint configuration from FEC (RedHatInsights#1908)
(no jira) This removes the old eslint configuration and replaces it with the one from https://github.com/RedHatInsights/frontend-starter-app so that Inventory is aligned with other apps in terms of linting and also using the latest custom rules provided by platform.
- Loading branch information
Showing
234 changed files
with
38,064 additions
and
29,751 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
src/demoData/* | ||
node_modules/* | ||
static/* | ||
dist/* |
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,21 @@ | ||
module.exports = { | ||
extends: [ | ||
'@redhat-cloud-services/eslint-config-redhat-cloud-services', | ||
'plugin:cypress/recommended', | ||
], | ||
globals: { | ||
insights: 'readonly', | ||
shallow: 'readonly', | ||
render: 'readonly', | ||
mount: 'readonly', | ||
IS_DEV: 'readonly', | ||
}, | ||
rules: { | ||
'sort-imports': [ | ||
'error', | ||
{ | ||
ignoreDeclarationSort: true, | ||
}, | ||
], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,109 +1,111 @@ | ||
/* global module, __dirname */ | ||
require.extensions['.css'] = () => undefined; | ||
const path = require('path'); | ||
const glob = require('glob'); | ||
|
||
const mapper = { | ||
TextVariants: 'Text', | ||
DropdownPosition: 'dropdownConstants', | ||
EmptyStateVariant: 'EmptyState', | ||
TextListItemVariants: 'TextListItem', | ||
TextListVariants: 'TextList', | ||
getDefaultOUIAId: 'ouia', | ||
useOUIAProps: 'ouia', | ||
PaginationVariant: 'Pagination' | ||
TextVariants: 'Text', | ||
DropdownPosition: 'dropdownConstants', | ||
EmptyStateVariant: 'EmptyState', | ||
TextListItemVariants: 'TextListItem', | ||
TextListVariants: 'TextList', | ||
getDefaultOUIAId: 'ouia', | ||
useOUIAProps: 'ouia', | ||
PaginationVariant: 'Pagination', | ||
}; | ||
|
||
const FECMapper = { | ||
SkeletonSize: 'Skeleton', | ||
PageHeaderTitle: 'PageHeader' | ||
SkeletonSize: 'Skeleton', | ||
PageHeaderTitle: 'PageHeader', | ||
}; | ||
|
||
const NotificationMapper = { | ||
REMOVE_NOTIFICATION: 'actionTypes', | ||
ADD_NOTIFICATION: 'actionTypes', | ||
NotificationsPortal: 'NotificationPortal/index', | ||
addNotification: 'actions' | ||
REMOVE_NOTIFICATION: 'actionTypes', | ||
ADD_NOTIFICATION: 'actionTypes', | ||
NotificationsPortal: 'NotificationPortal/index', | ||
addNotification: 'actions', | ||
}; | ||
|
||
const IconMapper = { | ||
AnsibeTowerIcon: 'ansibeTower-icon', | ||
ChartSpikeIcon: 'chartSpike-icon' | ||
AnsibeTowerIcon: 'ansibeTower-icon', | ||
ChartSpikeIcon: 'chartSpike-icon', | ||
}; | ||
|
||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: '> 0.25%, not dead' | ||
} | ||
], | ||
'@babel/react' | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: '> 0.25%, not dead', | ||
}, | ||
], | ||
'@babel/react', | ||
], | ||
plugins: [ | ||
[ | ||
'@babel/plugin-proposal-decorators', | ||
{ | ||
legacy: true, | ||
}, | ||
], | ||
plugins: [ | ||
[ | ||
'@babel/plugin-proposal-decorators', | ||
{ | ||
legacy: true | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-transform-runtime', | ||
'@babel/plugin-syntax-dynamic-import', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
[ | ||
'transform-imports', | ||
{ | ||
'@redhat-cloud-services/frontend-components-notifications': { | ||
transform: (importName) => | ||
`@redhat-cloud-services/frontend-components-notifications/${ | ||
NotificationMapper[importName] || importName | ||
}.js`, | ||
preventFullImport: true, | ||
}, | ||
'@redhat-cloud-services/frontend-components': { | ||
transform: (importName) => | ||
`@redhat-cloud-services/frontend-components/${ | ||
FECMapper[importName] || importName | ||
}`, | ||
preventFullImport: true, | ||
skipDefaultConversion: true, | ||
}, | ||
'@patternfly/react-icons': { | ||
transform: (importName) => | ||
`@patternfly/react-icons/dist/esm/icons/${ | ||
IconMapper[importName] || | ||
importName | ||
.split(/(?=[A-Z])/) | ||
.join('-') | ||
.toLowerCase() | ||
}.js`, | ||
preventFullImport: true, | ||
}, | ||
'@patternfly/react-core': { | ||
transform: (importName) => { | ||
const files = glob.sync( | ||
path.resolve( | ||
__dirname, | ||
`./node_modules/@patternfly/react-core/dist/esm/**/${ | ||
mapper[importName] || importName | ||
}.js` | ||
) | ||
); | ||
if (files.length > 0) { | ||
return files[0].replace(/.*(?=@patternfly)/, ''); | ||
} else { | ||
throw `File with importName ${importName} does not exist`; | ||
} | ||
], | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-transform-runtime', | ||
'@babel/plugin-syntax-dynamic-import', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
[ | ||
'transform-imports', | ||
{ | ||
'@redhat-cloud-services/frontend-components-notifications': { | ||
transform: (importName) => | ||
`@redhat-cloud-services/frontend-components-notifications/${ | ||
NotificationMapper[importName] || importName | ||
}.js`, | ||
preventFullImport: true | ||
}, | ||
'@redhat-cloud-services/frontend-components': { | ||
transform: (importName) => | ||
`@redhat-cloud-services/frontend-components/${FECMapper[importName] || importName}`, | ||
preventFullImport: true, | ||
skipDefaultConversion: true | ||
}, | ||
'@patternfly/react-icons': { | ||
transform: (importName) => | ||
`@patternfly/react-icons/dist/esm/icons/${IconMapper[importName] || importName | ||
.split(/(?=[A-Z])/) | ||
.join('-') | ||
.toLowerCase()}.js`, | ||
preventFullImport: true | ||
}, | ||
'@patternfly/react-core': { | ||
transform: (importName) => { | ||
const files = glob.sync( | ||
path.resolve( | ||
__dirname, | ||
`./node_modules/@patternfly/react-core/dist/esm/**/${mapper[ | ||
importName | ||
] || importName}.js` | ||
) | ||
); | ||
if (files.length > 0) { | ||
return files[0].replace(/.*(?=@patternfly)/, ''); | ||
} else { | ||
throw `File with importName ${importName} does not exist`; | ||
} | ||
}, | ||
preventFullImport: false, | ||
skipDefaultConversion: true | ||
} | ||
}, | ||
'frontend-notifications' | ||
] | ||
}, | ||
preventFullImport: false, | ||
skipDefaultConversion: true, | ||
}, | ||
}, | ||
'frontend-notifications', | ||
], | ||
env: { | ||
componentTest: { | ||
plugins: [ | ||
'istanbul' | ||
] | ||
} | ||
} | ||
], | ||
env: { | ||
componentTest: { | ||
plugins: ['istanbul'], | ||
}, | ||
}, | ||
}; |
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,9 +1,7 @@ | ||
/* global module */ | ||
|
||
module.exports = { | ||
Text: () => '', | ||
View: () => '', | ||
StyleSheet: { | ||
create: () => '' | ||
} | ||
Text: () => '', | ||
View: () => '', | ||
StyleSheet: { | ||
create: () => '', | ||
}, | ||
}; |
Oops, something went wrong.