Skip to content

Commit

Permalink
Merge pull request #177 from Charlie-Crowdstrike/feat/eslint-flat-con…
Browse files Browse the repository at this point in the history
…fig-compatible

feat: add meta fields and add duplicate processor with eslint-flat-co…
  • Loading branch information
kellyselden authored Aug 1, 2024
2 parents 98a28f2 + d8cd9dd commit 323d825
Showing 1 changed file with 15 additions and 1 deletion.
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'),
// 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')
};

0 comments on commit 323d825

Please sign in to comment.