Buckets:
| import { RuleTester } from 'eslint' | |
| import { rules } from '@next/eslint-plugin-next' | |
| const NextESLintRule = rules['no-assign-module-variable'] | |
| const tests = { | |
| valid: [ | |
| ` | |
| let myModule = {}; | |
| export default function MyComponent() { | |
| return <></> | |
| } | |
| `, | |
| ], | |
| invalid: [ | |
| { | |
| code: ` | |
| let module = {}; | |
| export default function MyComponent() { | |
| return <></> | |
| } | |
| `, | |
| errors: [ | |
| { | |
| message: | |
| 'Do not assign to the variable `module`. See: https://nextjs.org/docs/messages/no-assign-module-variable', | |
| }, | |
| ], | |
| }, | |
| ], | |
| } | |
| describe('no-assign-module-variable', () => { | |
| new RuleTester({ | |
| languageOptions: { | |
| ecmaVersion: 2018, | |
| sourceType: 'module', | |
| parserOptions: { | |
| ecmaFeatures: { | |
| modules: true, | |
| jsx: true, | |
| }, | |
| }, | |
| }, | |
| }).run('eslint', NextESLintRule, tests) | |
| }) | |
Xet Storage Details
- Size:
- 937 Bytes
- Xet hash:
- f0a65e5730f9e33b2c92857c074372177b25648da6305b508512da27cc1152d2
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.