Skip to content

Commit

Permalink
enable unicorn/prefer-logical-operator-over-ternary rule
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Dec 2, 2022
1 parent f7addb2 commit 04742d3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
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

0 comments on commit 04742d3

Please sign in to comment.