Open pdehaan opened 7 years ago
Actually, I tried a bit of hacking locally to get this work in my _/nodemodules/ directory...
I think the general steps (if this is worth pursuing) would be:
module.exports = {};
— see converted code below).main
field to the new .eslintrc.js
file.main
field to index.js.Create an index.js file in eslint-config-mofo-style with the following:
module.exports = require(`mofo-style`);
/**
* This is a baseline set of rules intended for usage in any ES6-based project.
* Be sure to add your project's specific environment(s) as needed via external configuration.
* See: http://eslint.org/docs/user-guide/configuring#specifying-environments
*/
module.exports = {
// http://eslint.org/docs/developer-guide/shareable-configs
"rules": {
// Possible Errors
"valid-jsdoc": "warn",
// Best Practices
"curly": "error",
"dot-notation": "error",
"eqeqeq": "error",
"guard-for-in": "error",
"no-div-regex": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-floating-decimal": "error",
"no-implied-eval": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-multi-spaces": "error",
"no-native-reassign": "error",
"no-new-wrappers": "error",
"no-new": "error",
"no-redeclare": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"radix": "error",
"wrap-iife": ["error", "inside"],
"yoda": ["error", "never"],
// Strict Mode
"strict": ["error", "global"],
// Variables
"no-shadow": "error",
"no-use-before-define": "error",
// Stylistic Issues
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"camelcase": ["error", {"properties": "always"}],
"comma-style": ["error", "last"],
"consistent-this": ["error", "self"],
"eol-last": "error",
"indent": ["error", 2, {"VariableDeclarator": {"var": 2, "let": 2, "const": 3}}],
"linebreak-style": ["error", "unix"],
"newline-after-var": "error",
"no-lonely-if": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
"quotes": ["error", "backtick"],
"semi": ["error", "always"],
"spaced-comment": ["error", "always"],
"wrap-regex": "error",
// ES6
"prefer-arrow-callback": "warn",
// Overrides to `eslint:recommended` rule set
"no-console": "off"
},
"extends": [
"eslint:recommended"
],
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"spread": true,
"templateStrings": true
}
};
Currently you have to do something like this to use the config:
If this module was published as eslint-config-mofo-style on npm, you could simplify this to:
Ref: http://eslint.org/docs/developer-guide/shareable-configs
You could possibly even use this module as a dependency for eslint-config-mofo-style and export the .eslintrc.yaml file.