Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable unicorn/prefer-logical-operator-over-ternary rule #2941

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions .changeset/dirty-turkeys-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'codemirror-graphql': patch
'graphiql': patch
'graphql-language-service': patch
---

enable `unicorn/prefer-logical-operator-over-ternary` rule
2 changes: 1 addition & 1 deletion packages/codemirror-graphql/src/__tests__/lint-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { TestSchema } from './testSchema';
function createEditorWithLint(lintConfig?: any) {
return CodeMirror(document.createElement('div'), {
mode: 'graphql',
lint: lintConfig ? lintConfig : true,
lint: lintConfig || true,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import '../mode';
function createEditorWithLint(lintConfig?: any) {
return CodeMirror(document.createElement('div'), {
mode: 'graphql-variables',
lint: lintConfig ? lintConfig : true,
lint: lintConfig || true,
});
}

Expand Down
4 changes: 1 addition & 3 deletions packages/graphiql/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ module.exports = ({ file, options }) => ({
plugins: {
'postcss-import': { root: file.dirname },
// contains autoprefixer, etc
'postcss-preset-env': options['postcss-preset-env']
? options['postcss-preset-env']
: false,
'postcss-preset-env': options['postcss-preset-env'] || false,
cssnano: process.env.NODE_ENV === 'production' ? options.cssnano : false,
},
});
4 changes: 1 addition & 3 deletions packages/graphiql/src/components/GraphiQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
<ToolbarButton onClick={() => copy()} label="Copy query (Shift-Ctrl-C)">
<CopyIcon className="graphiql-toolbar-icon" aria-hidden="true" />
</ToolbarButton>
{props.toolbar?.additionalContent
? props.toolbar.additionalContent
: null}
{props.toolbar?.additionalContent || null}
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function renderDeprecation(
return;
}

const reason = def.deprecationReason ? def.deprecationReason : null;
const reason = def.deprecationReason || null;
if (!reason) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ export default class CharacterStream implements CharacterStreamInterface {
public sol = (): boolean => this._pos === 0;

public peek = (): string | null => {
return this._sourceText.charAt(this._pos)
? this._sourceText.charAt(this._pos)
: null;
return this._sourceText.charAt(this._pos) || null;
};

public next = (): string => {
Expand Down