Skip to content

Commit

Permalink
Add flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
tamiroh committed Nov 12, 2024
1 parent 6499695 commit b2e220a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
19 changes: 19 additions & 0 deletions packages/eslint-config-airbnb-base/flat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const bestPractices = require('./rules/best-practices');
const errors = require('./rules/errors');
const node = require('./rules/flat/node');
const style = require('./rules/style');
const variables = require('./rules/variables');
const es6 = require('./rules/flat/es6');
const imports = require('./rules/flat/imports');
const strict = require('./rules/strict');

module.exports = [
bestPractices,
errors,
node,
style,
variables,
es6,
imports,
strict,
];
4 changes: 3 additions & 1 deletion packages/eslint-config-airbnb-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "index.js",
"exports": {
".": "./index.js",
"./flat": "./flat.js",
"./legacy": "./legacy.js",
"./whitespace": "./whitespace.js",
"./rules/best-practices": "./rules/best-practices.js",
Expand Down Expand Up @@ -87,6 +88,7 @@
"node": "^10.12.0 || >=12.0.0"
},
"dependencies": {
"confusing-browser-globals": "^1.0.11"
"confusing-browser-globals": "^1.0.11",
"globals": "^15.12.0"
}
}
12 changes: 12 additions & 0 deletions packages/eslint-config-airbnb-base/rules/flat/es6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const es6 = require('../es6');
const globals = require('globals');

module.exports = {
languageOptions: {
globals: {
...globals.es2015,
},
parserOptions: es6.parserOptions,
},
rules: es6.rules,
};
13 changes: 13 additions & 0 deletions packages/eslint-config-airbnb-base/rules/flat/imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const importPlugin = require('eslint-plugin-import');
const imports = require('../imports');

module.exports = {
languageOptions: {
parserOptions: imports.parserOptions,
},
plugins: {
import: importPlugin
},
settings: imports.settings,
rules: imports.rules,
};
11 changes: 11 additions & 0 deletions packages/eslint-config-airbnb-base/rules/flat/node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const globals = require('globals');
const node = require('../node');

module.exports = {
languageOptions: {
globals: {
...globals.es2015,
}
},
rules: node.rules,
};

0 comments on commit b2e220a

Please sign in to comment.