123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.getOptions = getOptions;
- exports.getESLintOptions = getESLintOptions;
- var _schemaUtils = require("schema-utils");
- var _options = _interopRequireDefault(require("./options.json"));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function getOptions(pluginOptions) {
- const options = {
- extensions: 'js',
- emitError: true,
- emitWarning: true,
- failOnError: true,
- ...pluginOptions,
- ...(pluginOptions.quiet ? {
- emitError: true,
- emitWarning: false
- } : {})
- };
- (0, _schemaUtils.validate)(_options.default, options, {
- name: 'ESLint Webpack Plugin',
- baseDataPath: 'options'
- });
- return options;
- }
- function getESLintOptions(loaderOptions) {
- const eslintOptions = { ...loaderOptions
- };
- const {
- fix,
- extensions,
- ...eslintOnlyOptions
- } = _options.default.properties;
-
- for (const option in eslintOnlyOptions) {
-
- delete eslintOptions[option];
- }
- return eslintOptions;
- }
|