Skip to content

Conversation

@brody4hire
Copy link
Owner

and remove the curly "Standard JS" exception from eslintrc.yml

The drawback is that some "Standard JS" indentation rules need to be turned off to avoid a conflict between "Standard JS" and Prettier(X).

It is highly desired by @brodybits to find a way to resolve the conflict between "Standard JS" and prettierx someday in the future.

@brody4hire brody4hire self-assigned this Dec 30, 2020
@brody4hire brody4hire changed the title use nested ternaries in tests, with recommended Prettier lint settings use nested ternaries in tests, with unwanted Prettier lint settings Dec 30, 2020
@brody4hire brody4hire changed the title use nested ternaries in tests, with unwanted Prettier lint settings use nested ternaries in tests, with some Prettier lint settings NOT WANTED Dec 30, 2020
@brody4hire brody4hire changed the title use nested ternaries in tests, with some Prettier lint settings NOT WANTED use nested ternaries in tests ... with some Prettier lint settings NOT WANTED Dec 31, 2020
extends: standard
extends:
- standard
- plugin:prettier/recommended
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggested change
- plugin:prettier/recommended

eslint 7.16.0 / 7.18.0 with eslint-config-standard (with no Prettier plugin enabled) wants to "fix" the test code like this in multiple places (NOT WANTED):

--- a/tests/init-with-example/init-with-example-with-log.test.js
+++ b/tests/init-with-example/init-with-example-with-log.test.js
@@ -40,8 +40,8 @@ jest.mock('execa', () => (cmd, args, opts) => {
   mockCallSnapshot.push({ execa: [cmd, args, opts] })
   return cmd === 'git'
     ? args[1] === 'user.email'
-      ? Promise.resolve({ stdout: 'alice@example.com' })
-      : Promise.resolve({ stdout: 'Alice' })
+        ? Promise.resolve({ stdout: 'alice@example.com' })
+        : Promise.resolve({ stdout: 'Alice' })
     : Promise.resolve()
 })

eslint 7.19.0 with eslint-config-standard (with no Prettier plugin enabled) wants to "fix" the code like this (NOT WANTED):

diff --git a/main.js b/main.js
index 78a623e..1fdda1e 100644
--- a/main.js
+++ b/main.js
@@ -196,22 +196,22 @@ Promise.resolve().then(async () => {
   const { androidPackageId } =
     platforms.indexOf('android') !== -1
       ? await prompt({
-          type: 'text',
-          name: 'androidPackageId',
-          message: 'What is the desired Android package id?',
-          initial: 'com.demo',
-          validate: androidPackageId => androidPackageId.length > 0
-        })
+        type: 'text',
+        name: 'androidPackageId',
+        message: 'What is the desired Android package id?',
+        initial: 'com.demo',
+        validate: androidPackageId => androidPackageId.length > 0
+      })
       : { androidPackageId: null }
 
   const { tvosEnabled } =
     platforms.indexOf('ios') !== -1
       ? await prompt({
-          type: 'confirm',
-          name: 'tvosEnabled',
-          message: 'Support Apple tvOS (requires react-native-tvos fork)?',
-          initial: false
-        })
+        type: 'confirm',
+        name: 'tvosEnabled',
+        message: 'Support Apple tvOS (requires react-native-tvos fork)?',
+        initial: false
+      })
       : { tvosEnabled: null }
 
   // THANKS to @react-native-community/bob for the idea
@@ -250,11 +250,11 @@ Promise.resolve().then(async () => {
   const { useAppleNetworking } =
     platforms.indexOf('ios') !== -1 && !isView
       ? await prompt({
-          type: 'confirm',
-          name: 'useAppleNetworking',
-          message: 'Generate with sample use of Apple Networking?',
-          initial: false
-        })
+        type: 'confirm',
+        name: 'useAppleNetworking',
+        message: 'Generate with sample use of Apple Networking?',
+        initial: false
+      })
       : { useAppleNetworking: false }
 
   log(INFO, 'It is possible to generate an example app for testing,')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants