@rajzik/config-eslint
Version:
Reusable ESLint config.
49 lines (48 loc) • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIgnoreList = exports.getExtendsList = void 0;
const core_1 = require("@beemo/core");
const lumos_common_1 = require("@rajzik/lumos-common");
function fromHere(filePath) {
return `./${new core_1.Path(process.cwd()).relativeTo(new core_1.Path(__dirname, '../lib', filePath).resolve())}`;
}
function getExtendsList({ next = false, node = false, prettier = false, typescript = false, }) {
const paths = [fromHere('presets/base.js')];
// Future rules
if (next) {
paths.push(fromHere('presets/next.js'));
}
// TypeScript
if (typescript) {
paths.push(fromHere('presets/typescript.js'));
}
// Node
if (node) {
paths.push(fromHere('presets/node.js'));
}
// Testing library
paths.push(fromHere('presets/testing-library.js'));
// Prettier (must be last)
if (prettier) {
paths.push(fromHere('presets/prettier.js'));
if (typescript) {
paths.push('prettier/@typescript-eslint');
}
if (next) {
paths.push('prettier/unicorn');
}
}
return paths;
}
exports.getExtendsList = getExtendsList;
function getIgnoreList() {
return [
...lumos_common_1.IGNORE_PATHS,
'jest.config.js',
'babel.config.js',
'webpack.config.js',
'build*/',
'\\.eslintrc.js',
];
}
exports.getIgnoreList = getIgnoreList;