Skip to content

Commit

Permalink
fix: use unicode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Oct 26, 2021
1 parent 5f6f9aa commit 0bf7612
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1882,11 +1882,11 @@ The following patterns are considered problems:
```js
interface foo{};
// Message: Interface identifier 'foo' does not match pattern '/^([A-Z][a-z0-9]*)+Type$/'.
// Message: Interface identifier 'foo' does not match pattern '/^([A-Z][a-z0-9]*)+Type$/u'.

// Options: ["^foo$"]
interface FooType{};
// Message: Interface identifier 'FooType' does not match pattern '/^foo$/'.
// Message: Interface identifier 'FooType' does not match pattern '/^foo$/u'.
```
The following patterns are not considered problems:
Expand Down Expand Up @@ -2222,12 +2222,12 @@ const text = 'HELLO';
// Options: ["TODO [0-9]+"]
// $FlowFixMe I am doing something evil here
const text = 'HELLO';
// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/`.
// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.

// Options: ["TODO [0-9]+"]
// $FlowFixMe TODO abc 47 I am doing something evil here
const text = 'HELLO';
// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/`.
// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.

// $$FlowFixMeProps I am doing something evil here
const text = 'HELLO';
Expand All @@ -2236,7 +2236,7 @@ const text = 'HELLO';
// Options: ["TODO [0-9]+"]
// $FlowFixMeProps I am doing something evil here
const text = 'HELLO';
// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/`.
// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.
```
The following patterns are not considered problems:
Expand Down Expand Up @@ -6687,14 +6687,14 @@ The following patterns are considered problems:

```js
opaque type foo = {};
// Message: Type identifier 'foo' does not match pattern '/^([A-Z][a-z0-9]*)+Type$/'.
// Message: Type identifier 'foo' does not match pattern '/^([A-Z][a-z0-9]*)+Type$/u'.
type foo = {};
// Message: Type identifier 'foo' does not match pattern '/^([A-Z][a-z0-9]*)+Type$/'.
// Message: Type identifier 'foo' does not match pattern '/^([A-Z][a-z0-9]*)+Type$/u'.
// Options: ["^foo$"]
type FooType = {};
// Message: Type identifier 'FooType' does not match pattern '/^foo$/'.
// Message: Type identifier 'FooType' does not match pattern '/^foo$/u'.
```

The following patterns are not considered problems:
Expand Down
4 changes: 2 additions & 2 deletions tests/rules/assertions/interfaceIdMatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ export default {
code: 'interface foo{};',
errors: [
{
message: 'Interface identifier \'foo\' does not match pattern \'/^([A-Z][a-z0-9]*)+Type$/\'.',
message: 'Interface identifier \'foo\' does not match pattern \'/^([A-Z][a-z0-9]*)+Type$/u\'.',
},
],
},
{
code: 'interface FooType{};',
errors: [
{
message: 'Interface identifier \'FooType\' does not match pattern \'/^foo$/\'.',
message: 'Interface identifier \'FooType\' does not match pattern \'/^foo$/u\'.',
},
],
options: [
Expand Down
6 changes: 3 additions & 3 deletions tests/rules/assertions/noFlowFixMeComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
code: '// $FlowFixMe I am doing something evil here\nconst text = \'HELLO\';',
errors: [
{
message: '$FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/`.',
message: '$FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.',
},
],
options: [
Expand All @@ -23,7 +23,7 @@ export default {
code: '// $FlowFixMe TODO abc 47 I am doing something evil here\nconst text = \'HELLO\';',
errors: [
{
message: '$FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/`.',
message: '$FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.',
},
],
options: [
Expand All @@ -42,7 +42,7 @@ export default {
code: '// $FlowFixMeProps I am doing something evil here\nconst text = \'HELLO\';',
errors: [
{
message: '$FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/`.',
message: '$FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.',
},
],
options: [
Expand Down
6 changes: 3 additions & 3 deletions tests/rules/assertions/typeIdMatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ export default {
code: 'opaque type foo = {};',
errors: [
{
message: 'Type identifier \'foo\' does not match pattern \'/^([A-Z][a-z0-9]*)+Type$/\'.',
message: 'Type identifier \'foo\' does not match pattern \'/^([A-Z][a-z0-9]*)+Type$/u\'.',
},
],
},
{
code: 'type foo = {};',
errors: [
{
message: 'Type identifier \'foo\' does not match pattern \'/^([A-Z][a-z0-9]*)+Type$/\'.',
message: 'Type identifier \'foo\' does not match pattern \'/^([A-Z][a-z0-9]*)+Type$/u\'.',
},
],
},
{
code: 'type FooType = {};',
errors: [
{
message: 'Type identifier \'FooType\' does not match pattern \'/^foo$/\'.',
message: 'Type identifier \'FooType\' does not match pattern \'/^foo$/u\'.',
},
],
options: [
Expand Down

0 comments on commit 0bf7612

Please sign in to comment.