Closed ASafaeirad closed 1 year ago
This PR adds a new init API let the developers have better control over the plugins and rules
The init API uses modules which defines as follows
interface Modules { auto?: boolean; react?: 'next' | 'raw'; typescript?: { parserProject: string[] | string; resolverProject: string[] | string }; node?: boolean; strict?: boolean; import?: boolean; esm?: boolean; graphql?: boolean; test?: boolean; cypress?: boolean; storybook?: boolean; };
And adds the init function that accepts the module's configuration. It allows the developer to have
init
const { init } = require('@fullstacksjs/eslint-config/init'); module.exports = init({ modules: { auto: true, esm: true, graphql: true, typescript: { parserProject: ['./tsconfig.eslint.json'], resolverProject: ['./tsconfig.json'], }, }, rules: { // }, });
instead of
module.exports = { extends: [ "@fullstacksjs", "@fullstacksjs/eslint-config/esm", "@fullstacksjs/eslint-config/typecheck", "@fullstacksjs/eslint-config/graphql" ], "parserOptions": { "project": ["./tsconfig.eslint.json"] }, "settings": { "import/resolver": { "typescript": { "project": ["./tsconfig.json"] }, }, }, // your configuration };
This PR adds a new init API let the developers have better control over the plugins and rules
The init API uses modules which defines as follows
And adds the
init
function that accepts the module's configuration. It allows the developer to haveinstead of