unicorn/import-style
eslint-plugin-unicorn
No autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/import-style": "error",
},
},
];const util = require('node:util');import util from 'node:util';import * as util from 'node:util';const {promisify} = require('node:util');import {promisify} from 'node:util';import path from 'node:path';Examples from the ESLint documentation.
unicorn/import-style
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/import-style": "error",
},
},
];unicorn/import-style
unicorn plugin · restriction
{
"rules": {
"unicorn/import-style": "error"
}
}Biome does not have this rule.
Move function definitions to the highest possible scope.
Enforce proper case for numeric literals.
Enforce consistent break/return/continue/throw position in case clauses.
Enforce consistent brace style for case clauses.
Prefer the spread operator over Array.from(…), Array#concat(…), Array#{slice,toSpliced}(), and trivial for…of copies.