Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE: potentially breaking dependency updates
  • Loading branch information
gajus committed Sep 14, 2021
1 parent a76ebd8 commit 00f0b4c
Show file tree
Hide file tree
Showing 28 changed files with 53 additions and 53 deletions.
8 changes: 4 additions & 4 deletions .README/rules/use-read-only-spread.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ You might expect the identifier name to be read-only, however, that's not true (
```flow js
const x: Identifier = { name: '', type: '' };
x.type = 'Should not be writable!'; // No Flow error
x.name = 'Should not be writable!'; // No Flow error
x.type = 'must NOT be writable!'; // No Flow error
x.name = 'must NOT be writable!'; // No Flow error
```

This rule suggests to use `$ReadOnly<…>` to prevent accidental loss of readonly-ness:
Expand All @@ -32,8 +32,8 @@ type Identifier = $ReadOnly<{|
const x: Identifier = { name: '', type: '' };
x.type = 'Should not be writable!'; // $FlowExpectedError[cannot-write]
x.name = 'Should not be writable!'; // $FlowExpectedError[cannot-write]
x.type = 'must NOT be writable!'; // $FlowExpectedError[cannot-write]
x.name = 'must NOT be writable!'; // $FlowExpectedError[cannot-write]
```

<!-- assertions useReadOnlySpread -->
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6625,8 +6625,8 @@ You might expect the identifier name to be read-only, however, that's not true (
```flow js
const x: Identifier = { name: '', type: '' };
x.type = 'Should not be writable!'; // No Flow error
x.name = 'Should not be writable!'; // No Flow error
x.type = 'must NOT be writable!'; // No Flow error
x.name = 'must NOT be writable!'; // No Flow error
```
This rule suggests to use `$ReadOnly<…>` to prevent accidental loss of readonly-ness:
Expand All @@ -6639,8 +6639,8 @@ type Identifier = $ReadOnly<{|
const x: Identifier = { name: '', type: '' };
x.type = 'Should not be writable!'; // $FlowExpectedError[cannot-write]
x.name = 'Should not be writable!'; // $FlowExpectedError[cannot-write]
x.type = 'must NOT be writable!'; // $FlowExpectedError[cannot-write]
x.name = 'must NOT be writable!'; // $FlowExpectedError[cannot-write]
```
The following patterns are considered problems:
Expand Down
2 changes: 1 addition & 1 deletion src/rules/arrayStyle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default (defaultConfig, simpleType) => {
GenericTypeAnnotation (node) {
if (node.id.name === 'Array') {
// Don't report on un-parameterized Array annotations. There are valid cases for this,
// but regardless, we should not crash when encountering them.
// but regardless, we must NOT crash when encountering them.
if (node.typeParameters && node.typeParameters.params.length === 1) {
const elementTypeNode = node.typeParameters.params[0];
const rawElementType = context.getSourceCode().getText(elementTypeNode);
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/arrayStyleComplexType.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
errors: [
{
data: 'normal',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/arrayStyleSimpleType.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default {
errors: [
{
data: 'normal',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/arrowParens.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default {
// errors: [
// {
// keyword: 'enum',
// dataPath: '[0]',
// instancePath: '/0',
// schemaPath: '#/items/0/enum',
// params: {
// allowedValues: [
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/booleanStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
errors: [
{
data: 'integer',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/delimiterDangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ const MISCONFIGURED = [
errors: [
{
data: 'occasionally',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/genericSpacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default {
errors: [
{
data: 'frequently',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/interfaceIdMatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
errors: [
{
data: 7,
dataPath: '[0]',
instancePath: '/0',
keyword: 'type',
message: 'must be string',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/noFlowFixMeComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
errors: [
{
data: 7,
dataPath: '[0]',
instancePath: '/0',
keyword: 'type',
message: 'must be string',
params: {
Expand Down
6 changes: 3 additions & 3 deletions tests/rules/assertions/noWeakTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ export default {
data: {
nonExistentWeakType: false,
},
dataPath: '[0]',
instancePath: '/0',
keyword: 'additionalProperties',
message: 'should NOT have additional properties',
message: 'must NOT have additional properties',
params: {
additionalProperty: 'nonExistentWeakType',
},
Expand Down Expand Up @@ -231,7 +231,7 @@ export default {
errors: [
{
data: 'irrelevant',
dataPath: '[0].Object',
instancePath: '/0/Object',
keyword: 'type',
message: 'must be boolean',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/objectTypeCurlySpacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default {
errors: [
{
data: 'sometimes',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/objectTypeDelimiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default {
errors: [
{
data: 'period',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default {
errors: [
{
data: 'temporarily',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/requireCompoundTypeAlias.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
errors: [
{
data: 'sometimes',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
8 changes: 4 additions & 4 deletions tests/rules/assertions/requireParameterType.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ export default {
data: {
excludeOtherStuff: true,
},
dataPath: '[0]',
instancePath: '/0',
keyword: 'additionalProperties',
message: 'should NOT have additional properties',
message: 'must NOT have additional properties',
params: {
additionalProperty: 'excludeOtherStuff',
},
Expand Down Expand Up @@ -174,7 +174,7 @@ export default {
errors: [
{
data: 'everything',
dataPath: '[0].excludeArrowFunctions',
instancePath: '/0/excludeArrowFunctions',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down Expand Up @@ -205,7 +205,7 @@ export default {
errors: [
{
data: 3,
dataPath: '[0].excludeParameterMatch',
instancePath: '/0/excludeParameterMatch',
keyword: 'type',
message: 'must be string',
params: {
Expand Down
12 changes: 6 additions & 6 deletions tests/rules/assertions/requireReturnType.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ export default {
data: {
excludeOtherStuff: true,
},
dataPath: '[1]',
instancePath: '/1',
keyword: 'additionalProperties',
message: 'should NOT have additional properties',
message: 'must NOT have additional properties',
params: {
additionalProperty: 'excludeOtherStuff',
},
Expand Down Expand Up @@ -491,7 +491,7 @@ export default {
errors: [
{
data: 'often',
dataPath: '[1].annotateUndefined',
instancePath: '/1/annotateUndefined',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down Expand Up @@ -526,7 +526,7 @@ export default {
errors: [
{
data: 'everything',
dataPath: '[1].excludeArrowFunctions',
instancePath: '/1/excludeArrowFunctions',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down Expand Up @@ -557,7 +557,7 @@ export default {
errors: [
{
data: '^foo',
dataPath: '[1].excludeMatching',
instancePath: '/1/excludeMatching',
keyword: 'type',
message: 'must be array',
params: {
Expand All @@ -579,7 +579,7 @@ export default {
errors: [
{
data: false,
dataPath: '[1].includeOnlyMatching[0]',
instancePath: '/1/includeOnlyMatching/0',
keyword: 'type',
message: 'must be string',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/requireTypesAtTop.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
errors: [
{
data: 'sometimes',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
4 changes: 2 additions & 2 deletions tests/rules/assertions/requireValidFileAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export default {
errors: [
{
data: 'sometimes',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down Expand Up @@ -307,7 +307,7 @@ export default {
errors: [
{
data: 'upside-down',
dataPath: '[1].annotationStyle',
instancePath: '/1/annotationStyle',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
12 changes: 6 additions & 6 deletions tests/rules/assertions/requireVariableType.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export default {
data: {
excludeOtherStuff: true,
},
dataPath: '[0]',
instancePath: '/0',
keyword: 'additionalProperties',
message: 'should NOT have additional properties',
message: 'must NOT have additional properties',
params: {
additionalProperty: 'excludeOtherStuff',
},
Expand Down Expand Up @@ -93,7 +93,7 @@ export default {
errors: [
{
data: 99,
dataPath: '[0].excludeVariableMatch',
instancePath: '/0/excludeVariableMatch',
keyword: 'type',
message: 'must be string',
params: {
Expand All @@ -114,9 +114,9 @@ export default {
data: {
declare: false,
},
dataPath: '[0].excludeVariableTypes',
instancePath: '/0/excludeVariableTypes',
keyword: 'additionalProperties',
message: 'should NOT have additional properties',
message: 'must NOT have additional properties',
params: {
additionalProperty: 'declare',
},
Expand Down Expand Up @@ -145,7 +145,7 @@ export default {
errors: [
{
data: 'yes',
dataPath: '[0].excludeVariableTypes.let',
instancePath: '/0/excludeVariableTypes/let',
keyword: 'type',
message: 'must be boolean',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/semi.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default {
errors: [
{
data: 'temporarily',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/sortKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export default {
errors: [
{
data: 'random',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
8 changes: 4 additions & 4 deletions tests/rules/assertions/spaceAfterTypeColon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ const MISCONFIGURED = [
errors: [
{
data: 'from time to time',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down Expand Up @@ -1151,9 +1151,9 @@ const MISCONFIGURED = [
data: {
allowEmoji: true,
},
dataPath: '[1]',
instancePath: '/1',
keyword: 'additionalProperties',
message: 'should NOT have additional properties',
message: 'must NOT have additional properties',
params: {
additionalProperty: 'allowEmoji',
},
Expand All @@ -1176,7 +1176,7 @@ const MISCONFIGURED = [
errors: [
{
data: 'why not?',
dataPath: '[1].allowLineBreak',
instancePath: '/1/allowLineBreak',
keyword: 'type',
message: 'must be boolean',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/spaceBeforeGenericBracket.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
errors: [
{
data: 'whenever',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/assertions/spaceBeforeTypeColon.js
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ const MISCONFIGURED = [
errors: [
{
data: 'wherever',
dataPath: '[0]',
instancePath: '/0',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: {
Expand Down
Loading

0 comments on commit 00f0b4c

Please sign in to comment.