Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (24 loc) · 717 Bytes

no-cjs-in-config.md

File metadata and controls

40 lines (24 loc) · 717 Bytes

nuxt/no-cjs-in-config

Disallow commonjs module api require/modules.exports/exports in nuxt.config.js

  • ⚙️ This rule is included in "plugin:nuxt/base".

Rule Details

This rule is for preventing using require/modules.exports/exports in nuxt.config.js

Examples of incorrect code for this rule:

const { name } = require('./package.json')

module.exports = {
  mode: 'universal',
  name
}

Examples of correct code for this rule:

import { name } from './package.json'

export default {
  mode: 'universal',
  name
}

🔍 Implementation