Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: enable logical-assignment-operators rule internally#7484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions.eslintrc.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,6 +121,7 @@ module.exports = {
null: 'never',
},
],
'logical-assignment-operators': 'error',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

[Praise] 👌 and it even respects the existing alphabetical order of rules!!

'no-else-return': 'error',
'no-mixed-operators': 'error',
'no-console': 'error',
Expand Down
17 changes: 8 additions & 9 deletionspackages/eslint-plugin/src/rules/consistent-type-imports.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -105,15 +105,14 @@ export default util.createRule<Options, MessageIds>({
ImportDeclaration(node): void {
const source = node.source.value;
// sourceImports is the object containing all the specifics for a particular import source, type or value
const sourceImports =
sourceImportsMap[source] ??
(sourceImportsMap[source] = {
source,
reportValueImports: [], // if there is a mismatch where type importKind but value specifiers
typeOnlyNamedImport: null, // if only type imports
valueOnlyNamedImport: null, // if only value imports with named specifiers
valueImport: null, // if only value imports
});
sourceImportsMap[source] ??= {
source,
reportValueImports: [], // if there is a mismatch where type importKind but value specifiers
typeOnlyNamedImport: null, // if only type imports
valueOnlyNamedImport: null, // if only value imports with named specifiers
valueImport: null, // if only value imports
};
const sourceImports = sourceImportsMap[source];
if (node.importKind === 'type') {
if (
!sourceImports.typeOnlyNamedImport &&
Expand Down
2 changes: 1 addition & 1 deletionpackages/eslint-plugin/src/rules/unified-signatures.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -521,7 +521,7 @@ export default util.createRule<Options, MessageIds>({
key?: string,
containingNode?: ContainingNode,
): void {
key= key ?? getOverloadKey(signature);
key??= getOverloadKey(signature);
if (
currentScope &&
(containingNode || signature).parent === currentScope.parent
Expand Down
2 changes: 1 addition & 1 deletionpackages/rule-tester/src/utils/config-validator.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -248,7 +248,7 @@ function validateConfigSchema(
config: TesterConfigWithDefaults,
source: string,
): void {
validateSchema= validateSchema || ajv.compile(configSchema);
validateSchema||= ajv.compile(configSchema);

if (!validateSchema(config)) {
throw new Error(
Expand Down
7 changes: 3 additions & 4 deletionspackages/scope-manager/src/referencer/ClassVisitor.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -154,10 +154,9 @@ class ClassVisitor extends Visitor {
* ) {}
* }
*/
withMethodDecorators =
withMethodDecorators ||
(methodNode.kind !== 'set' &&
node.params.some(param => param.decorators.length));
withMethodDecorators ||=
methodNode.kind !== 'set' &&
node.params.some(param => param.decorators.length);
if (!withMethodDecorators && methodNode.kind === 'set') {
const keyName = getLiteralMethodKeyName(methodNode);

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -180,8 +180,7 @@ function getWatchProgramsForProjects(
if (fileList.has(filePath)) {
log('Found existing program for file. %s', filePath);

updatedProgram =
updatedProgram ?? existingWatch.getProgram().getProgram();
updatedProgram ??= existingWatch.getProgram().getProgram();
// sets parent pointers in source files
updatedProgram.getTypeChecker();

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ function ConfigTypeScript(props: ConfigTypeScriptProps): React.JSX.Element {
getTypescriptOptions().reduce<Record<string, ConfigOptionsType>>(
(group, item) => {
const category = item.category!.message;
group[category]= group[category] ?? {
group[category]??= {
heading: category,
fields: [],
};
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp