fix: work around ljharb's ignorance

This commit is contained in:
cha0s 2021-03-31 10:35:43 -05:00
parent d484d0d30f
commit 97d90ee809
4 changed files with 25 additions and 7 deletions

View File

@ -25,6 +25,7 @@
], ],
"dependencies": { "dependencies": {
"@babel/eslint-parser": "^7.13.10", "@babel/eslint-parser": "^7.13.10",
"@babel/eslint-plugin": "^7.13.10",
"@babel/parser": "^7.13.12", "@babel/parser": "^7.13.12",
"@babel/plugin-proposal-class-properties": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/plugin-proposal-optional-chaining": "^7.12.16", "@babel/plugin-proposal-optional-chaining": "^7.12.16",

View File

@ -20,6 +20,9 @@ const config = {
configFile: LATUS_BABEL_CONFIG, configFile: LATUS_BABEL_CONFIG,
}, },
}, },
plugins: [
'@babel',
],
rules: { rules: {
'babel/object-curly-spacing': 'off', 'babel/object-curly-spacing': 'off',
'brace-style': ['error', 'stroustrup'], 'brace-style': ['error', 'stroustrup'],

View File

@ -11,12 +11,20 @@ const {
module.exports = { module.exports = {
options: {}, options: {},
use: [ use: [
airbnb({ (neutrino) => {
eslint: { const baseConfig = require(LATUS_ESLINT_DEFAULTS);
cache: false, const {peerDependencies = {}} = neutrino.options.packageJson;
baseConfig: require(LATUS_ESLINT_DEFAULTS), const peerPaths = Object.keys(peerDependencies);
}, if (peerPaths.length > 0) {
}), baseConfig.rules['import/no-unresolved'] = ['error', {ignore: peerPaths}];
}
airbnb({
eslint: {
cache: false,
baseConfig,
},
})(neutrino);
},
react(), react(),
library(), library(),
mocha(), mocha(),

View File

@ -18,10 +18,16 @@ const {
export default (latus) => (neutrino) => { export default (latus) => (neutrino) => {
const airbnb = R('@neutrinojs/airbnb'); const airbnb = R('@neutrinojs/airbnb');
const baseConfig = R(LATUS_ESLINT_DEFAULTS);
const {peerDependencies = {}} = neutrino.options.packageJson;
const peerPaths = Object.keys(peerDependencies);
if (peerPaths.length > 0) {
baseConfig.rules['import/no-unresolved'] = ['error', {ignore: peerPaths}];
}
airbnb({ airbnb({
eslint: { eslint: {
cache: false, cache: false,
baseConfig: R(LATUS_ESLINT_DEFAULTS), baseConfig,
}, },
})(neutrino); })(neutrino);
const clean = R('@neutrinojs/clean'); const clean = R('@neutrinojs/clean');