Rewrite .eslintrc.es5.js to new config format
[MAILPOET-5015]
This commit is contained in:
@ -1,18 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['airbnb/legacy', 'prettier'],
|
||||
env: {
|
||||
amd: true,
|
||||
browser: true,
|
||||
},
|
||||
plugins: ['eslint-plugin-import'],
|
||||
parser: '@babel/eslint-parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {
|
||||
'import/prefer-default-export': 0, // we want to stop using default exports and start using named exports
|
||||
'no-underscore-dangle': 0, // Backbone uses underscores, we cannot remove them
|
||||
'import/no-default-export': 1, // no default exports
|
||||
},
|
||||
};
|
36
packages/js/eslint-config/eslint-es5.config.js
Normal file
36
packages/js/eslint-config/eslint-es5.config.js
Normal file
@ -0,0 +1,36 @@
|
||||
const babelParser = require('@babel/eslint-parser');
|
||||
const FlatCompat = require('@eslint/eslintrc').FlatCompat;
|
||||
const airbnbLegacyConfig = require('eslint-config-airbnb/legacy');
|
||||
const prettierConfig = require('eslint-config-prettier');
|
||||
const importPlugin = require('eslint-plugin-import');
|
||||
const globals = require('globals');
|
||||
|
||||
// compat configs
|
||||
const compat = new FlatCompat({ baseDirectory: __dirname });
|
||||
const airbnbLegacyCompatConfig = compat.config(airbnbLegacyConfig);
|
||||
const prettierCompatConfig = compat.config(prettierConfig);
|
||||
|
||||
module.exports = [
|
||||
...airbnbLegacyCompatConfig,
|
||||
...prettierCompatConfig,
|
||||
{
|
||||
languageOptions: {
|
||||
parser: babelParser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
import: importPlugin,
|
||||
},
|
||||
rules: {
|
||||
'import/prefer-default-export': 0, // we want to stop using default exports and start using named exports
|
||||
'no-underscore-dangle': 0, // Backbone uses underscores, we cannot remove them
|
||||
'import/no-default-export': 1, // no default exports
|
||||
},
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user