UNPKG

@boehringer-ingelheim/eslint-config

Version:

Shared eslint configuration used at Boehringer Ingelheim for code styling

127 lines 5.05 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const eslint_plugin_next_1 = __importDefault(require("@next/eslint-plugin-next")); const config_1 = require("eslint/config"); const nextjs_utils_js_1 = require("../lib/nextjs.utils.js"); const react_js_1 = __importDefault(require("./react.js")); exports.default = (0, config_1.defineConfig)(...react_js_1.default, { plugins: { '@next/next': eslint_plugin_next_1.default, }, rules: { ...eslint_plugin_next_1.default.configs.recommended.rules, ...eslint_plugin_next_1.default.configs['core-web-vitals'].rules, }, }, { files: [`{app,src/app}/**/{${nextjs_utils_js_1.NEXTJS_ROUTING_FILES.join(',')}}.{ts,tsx}`], rules: { 'import/no-unused-modules': ['off'], // eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh 'react-refresh/only-export-components': [ 'warn', { allowExportNames: [ /** * Next.js allows exporting the following options in pages, layouts and route handlers * * @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config */ 'dynamic', 'dynamicParams', 'fetchCache', 'maxDuration', 'preferredRegion', 'revalidate', 'runtime', /** * Next.js allows exporting the following metadata options in layouts and pages * * @link https://nextjs.org/docs/app/api-reference/functions/generate-metadata */ 'generateMetadata', 'metadata', /** * Next.js allows exporting the following static params functions in pages * * @link https://nextjs.org/docs/app/api-reference/functions/generate-static-params */ 'generateStaticParams', /** * Next.js allows exporting the following viewport options in layouts and pages * * @link https://nextjs.org/docs/app/api-reference/functions/generate-viewport */ 'generateViewport', 'viewport', ], }, ], }, }, { files: [`{instrumentation,src/instrumentation}.{ts,tsx}`], rules: { 'import/no-unused-modules': ['off'], // eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh 'react-refresh/only-export-components': [ 'warn', { allowExportNames: [ /** * Next.js allows exporting the following exports in instrumentation files * * @link https://nextjs.org/docs/app/guides/instrumentation#convention */ 'register', ], }, ], }, }, { /** * Next.js 'middleware' files are beeing deprecated in favor of the new proxy files with v16+ * * @link https://nextjs.org/blog/next-16#proxyts-formerly-middlewarets */ files: [`{middleware,src/middleware}.{ts,tsx}`], rules: { 'import/no-unused-modules': ['off'], // eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh 'react-refresh/only-export-components': [ 'warn', { allowExportNames: [ /** * Next.js allows exporting the following config options in middleware * * @link https://nextjs.org/docs/app/api-reference/file-conventions/middleware#config-object-optional */ 'config', ], }, ], }, }, { files: [`{proxy,src/proxy}.{ts,tsx}`], rules: { 'import/no-unused-modules': ['off'], // eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh 'react-refresh/only-export-components': [ 'warn', { allowExportNames: [ /** * Next.js allows exporting the following exports in proxy files * * @link https://nextjs.org/docs/app/api-reference/file-conventions/proxy#config-object-optional */ 'config', 'proxy', ], }, ], }, }); //# sourceMappingURL=nextjs.js.map