-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de9dd70
commit 1601a12
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
packages/eslint-config-bananass/src/rules/import-module-systems.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* @fileoverview This file follows: | ||
* | ||
* - The order of the rules listed in the 'Module Systems' section on eslint-plugin-import. | ||
* - See, {@link https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#module-systems}. | ||
* | ||
* - The best practices outlined in `[email protected]`. | ||
* - See, {@link https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js}. | ||
*/ | ||
|
||
// -------------------------------------------------------------------------------- | ||
// Exports | ||
// -------------------------------------------------------------------------------- | ||
|
||
module.exports = { | ||
/** | ||
* Forbid AMD `require` and `define` calls. | ||
* | ||
* @link import: {@link https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md} | ||
* @link airbnb-base: {@link https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js#L111} | ||
*/ | ||
'import/no-amd': 'error', | ||
|
||
/** | ||
* Forbid CommonJS `require` calls and `module.exports` or `exports.*`. | ||
* | ||
* @link import: {@link https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md} | ||
* @link airbnb-base: {@link https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js#L107} | ||
*/ | ||
'import/no-commonjs': 'off', | ||
|
||
/** | ||
* Forbid import statements with CommonJS `module.exports`. | ||
* | ||
* @description I've deleted unnecessary options from `airbnb-base`. | ||
* @link import: {@link https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md} | ||
* @link airbnb-base: {@link https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js#L265-L267} | ||
*/ | ||
'import/no-import-module-exports': 'error', | ||
|
||
/** | ||
* Forbid Node.js builtin modules. | ||
* | ||
* @link import: {@link https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md} | ||
* @link airbnb-base: {@link https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js#L116} | ||
*/ | ||
'import/no-nodejs-modules': 'off', | ||
|
||
/** | ||
* Forbid potentially ambiguous parse goal (`script` vs. `module`). | ||
* | ||
* @link import: {@link https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md} | ||
* @link airbnb-base: {@link https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/imports.js#L186} | ||
*/ | ||
'import/unambiguous': 'off', | ||
}; |