Commit 99f98755 authored by Albert Salim's avatar Albert Salim

Update eslintrc to ignore generated file imports

parent ff4773d4
/* eslint-disable import/no-commonjs */
/* eslint-disable import/no-extraneous-dependencies */
const Resolver = require('jest-resolve');
// Wrap jest default resolver to detect missing frontend fixtures.
module.exports = (request, options) => {
try {
return options.defaultResolver(request, options)
return options.defaultResolver(request, options);
} catch (e) {
if (Resolver.tryCastModuleNotFoundError(e) && request.match(/tmp\/tests\/frontend\/fixtures/)) {
console.error('\x1b[1m\x1b[41m\x1b[30m %s \x1b[0m %s', '!', `Fixture file ${request} does not exist. Did you run bin/rake frontend:fixtures?`)
/* eslint-disable no-console */
/* eslint-disable @gitlab/require-i18n-strings */
console.error(
'\x1b[1m\x1b[41m\x1b[30m %s \x1b[0m %s',
'!',
`Fixture file ${request} does not exist. Did you run bin/rake frontend:fixtures?`,
);
}
throw e;
}
......
......@@ -26,4 +26,9 @@ rules:
- off
"@gitlab/no-global-event-off":
- off
import/no-unresolved:
- error
# The test fixtures and graphql schema are dynamically generated in CI
# during the `frontend-fixtures` and `graphql-schema-dump` jobs.
# They may not be present during linting.
- ignore: ['^test_fixtures\/', 'tmp/tests/graphql/gitlab_schema.graphql']
import { secondsToHours } from '~/lib/utils/datetime_utility';
import freezePeriodsFixture from 'test_fixtures/api/freeze-periods/freeze_periods.json';
import timezoneDataFixture from 'test_fixtures/timezones/short.json';
import { secondsToHours } from '~/lib/utils/datetime_utility';
export { freezePeriodsFixture, timezoneDataFixture };
......
import { buildSchema, graphql } from 'graphql';
import { memoize } from 'lodash';
// The graphql schema is dynamically generated in CI
// during the `graphql-schema-dump` job.
// eslint-disable-next-line global-require, import/no-unresolved
// eslint-disable-next-line global-require
const getGraphqlSchema = () => require('../../../../tmp/tests/graphql/gitlab_schema.graphql');
const graphqlResolvers = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment