<commit_before>import { expect } from 'chai';
import fs from 'fs';
import path from 'path';
import { Validator } from 'jsonschema';

import { transform } from '../../utils/helpers';
import formConfig from '../../config/form';
import fullSchemaPreNeed from 'vets-json-schema/dist/40-10007-schema.json';

describe('pre-need schema tests', () => {
  const v = new Validator();
  const files = fs.readdirSync(__dirname);
  files.filter(file => file.endsWith('json')).forEach(file => {
    const contents = JSON.parse(
      fs.readFileSync(path.join(__dirname, file), 'utf8'),
    );
    const submitData = transform(formConfig, contents);
    it(`should validate ${file}`, () => {
      const result = v.validate(JSON.parse(submitData), fullSchemaPreNeed);

      if (!result.valid) {
          console.log(result.errors); // eslint-disable-line
      }
      expect(result.valid).to.be.true;
    });
  });
});<commit_msg>Fix abusive eslint disable in pre-need (#12550)<commit_after>import { expect } from 'chai';
import fs from 'fs';
import path from 'path';
import { Validator } from 'jsonschema';

import { transform } from '../../utils/helpers';
import formConfig from '../../config/form';
import fullSchemaPreNeed from 'vets-json-schema/dist/40-10007-schema.json';

describe('pre-need schema tests', () => {
  const v = new Validator();
  const files = fs.readdirSync(__dirname);
  files.filter(file => file.endsWith('json')).forEach(file => {
    const contents = JSON.parse(
      fs.readFileSync(path.join(__dirname, file), 'utf8'),
    );
    const submitData = transform(formConfig, contents);
    it(`should validate ${file}`, () => {
      const result = v.validate(JSON.parse(submitData), fullSchemaPreNeed);

      if (!result.valid) {
        console.log(result.errors); // eslint-disable-line no-console
      }
      expect(result.valid).to.be.true;
    });
  });
});
{'fraction_non_alphanumeric': 0.17065390749601275, 'fraction_numerical': 0.011164274322169059, 'mean_word_length': 3.5902439024390245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6958321', 'n_tokens_mistral': 585, 'n_tokens_neox': 576, 'n_words': 131}