camelcase
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"camelcase": "error",
},
},
];const { category_id } = query;
const { category_name = 1 } = query;
const { category_id: category_title } = query;
const { category_id: category_alias } = query;
const { category_id: categoryId, ...other_props } = query;const { category_id: category_alias } = query;
const { category_id, ...other_props } = query;const { some_property } = obj; // allowed by {ignoreDestructuring: true}
const foo = some_property + 1; // error, ignoreDestructuring does not apply to this statementimport { no_camelcased as camelCased } from "external-module";
const myFavoriteColor = "#112C85";
const _myFavoriteColor = "#112C85";
const myFavoriteColor_ = "#112C85";
const MY_FAVORITE_COLOR = "#112C85";
const foo1 = bar.baz_boom;
const foo2 = { qux: bar.baz_boom };
obj.do_something();
do_something();
new do_something();
const { category_id: category } = query;
function foo({ isCamelCased }) {
// ...
};
function bar({ isCamelCased: isAlsoCamelCased }) {
// ...
}
function baz({ isCamelCased = 'default value' }) {
// ...
};
const { categoryId = 1 } = query;
const { foo: isCamelCased } = bar;
const { foo: camelCasedName = 1 } = quz;const obj = {
my_pref: 1
};
obj.foo_bar = "baz";const { category_id } = query;
const { category_name = 1 } = query;
const { category_id_name: category_id_name } = query;Examples from the ESLint documentation.
camelcase
eslint
export default [
{
rules: {
"camelcase": "error",
},
},
];Oxlint does not have this rule.
style/useNamingConvention
style · since 1.0.0
{
"linter": {
"rules": {
"style": {
"useNamingConvention": "error"
}
}
}
}Disallow the use of alert, confirm, and prompt
Disallow certain properties on certain objects
Enforce consistent brace style for all control statements