Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add meta fields and add duplicate processor with eslint-flat-co… #177

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@

const requireIndex = require('requireindex');
const path = require('path');
const { name, version } = require('../package.json');

module.exports.rules = requireIndex(path.join(__dirname, 'rules'));

// optional for our current use case but required if we ever want to use
// -cache and --print-config command line options.
// https://eslint.org/docs/latest/extend/plugin-migration-flat-config#adding-plugin-meta-information
module.exports.meta = {
name,
version
},

module.exports.processors = {
'.json': require('./processors/json')
// .json is from previous versions, so we are leaving it in
// for backward compatibility with < v9 eslint versions
'.json': require('./processors/json'),
Charlie-Crowdstrike marked this conversation as resolved.
Show resolved Hide resolved
// dot prefix is no longer allowed in eslint v9
// https://eslint.org/docs/latest/extend/plugin-migration-flat-config#migrating-processors-for-flat-config
'json': require('./processors/json')
};
Loading