Skip to content

Commit

Permalink
Rewrite rules to plain format
Browse files Browse the repository at this point in the history
PR-URL: #76
  • Loading branch information
tshemsedinov committed Aug 13, 2024
1 parent c5eb9ca commit 902577c
Show file tree
Hide file tree
Showing 16 changed files with 233 additions and 1,739 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

8 changes: 3 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

module.exports = [
{
ignores: ['node_modules/*'],
},
];
const init = require('./index.js');

module.exports = init;
44 changes: 30 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
'use strict';

const rules = [
'./rules/possible-errors',
'./rules/best-practices',
'./rules/strict-mode',
'./rules/variables',
'./rules/nodejs-and-commonjs',
'./rules/stylistic-issues',
'./rules/ecmascript-6',
'./rules/plugin-import',
'./rules/parser-options',
'./rules/ecmascript-13',
].map(require.resolve);
const { recommended } = require('@eslint/js').configs;

module.exports = {
extends: ['eslint:recommended', ...rules],
const metarhia = {
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'commonjs',
globals: {
BigInt: true,
},
},
ignores: ['node_modules/*'],
rules: {},
};

const files = [
'./rules/possible-errors.js',
'./rules/best-practices.js',
'./rules/strict-mode.js',
'./rules/variables.js',
'./rules/nodejs-and-commonjs.js',
'./rules/stylistic-issues.js',
'./rules/ecmascript-6.js',
'./rules/ecmascript-13.js',
];

const sections = files.map(require);

for (const section of sections) {
Object.assign(metarhia.rules, section);
}

module.exports = [recommended, metarhia];
Loading

0 comments on commit 902577c

Please sign in to comment.