Skip to content
Closed
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
12 changes: 9 additions & 3 deletions packages/eslint-config-react-native-community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = {

rules: {
// General
'comma-dangle': [1, 'always-multiline'], // allow or disallow trailing commas
Comment thread
iRoachie marked this conversation as resolved.
Outdated
'comma-dangle': 0, // allow or disallow trailing commas (off by default)
'no-cond-assign': 1, // disallow assignment in conditional expressions
'no-console': 0, // disallow use of console (off by default in the node environment)
'no-const-assign': 2, // disallow assignment to const-declared variables
Expand Down Expand Up @@ -250,9 +250,9 @@ module.exports = {
'no-trailing-spaces': 1, // disallow trailing whitespace at the end of lines
'no-underscore-dangle': 0, // disallow dangling underscores in identifiers
'no-mixed-spaces-and-tabs': 1, // disallow mixed spaces and tabs for indentation
quotes: [1, 'single', 'avoid-escape'], // specify whether double or single quotes should be used
quotes: 0, // specify whether double or single quotes should be used (off by default)
'quote-props': 0, // require quotes around object literal property names (off by default)
semi: 1, // require or disallow use of semicolons instead of ASI
semi: 0, // require or disallow use of semicolons instead of ASI (off by default)
'sort-vars': 0, // sort variables within the same declaration block (off by default)
'space-in-brackets': 0, // require or disallow spaces inside brackets (off by default)
'space-in-parens': 0, // require or disallow spaces inside parentheses (off by default)
Expand Down Expand Up @@ -309,5 +309,11 @@ module.exports = {
'jest/no-focused-tests': 1,
'jest/no-identical-title': 1,
'jest/valid-expect': 1,

// Prettier Plugin
'prettier/prettier': [
Comment thread
iRoachie marked this conversation as resolved.
Outdated
1,
{singleQuote: true, trailingComma: 'es5', semi: true},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@iRoachie - I wonder how this section is related to the default content of .prettierrc.js:

module.exports = {
  bracketSpacing: false,
  jsxBracketSameLine: true,
  singleQuote: true,
  trailingComma: 'all',
};

Does it override and/or make it (partially) obsolete?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure exactly, what i do know is that the contents of that file doesn’t get passed onto user projects and previously you had to have a .prettierrc of your own

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay thanks for your reply. If (part of?) that file is obsolete (after updating the @react-native-community/eslint-config dependency), maybe we should update the template file as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's still useful for formatting a file manually, and formatting non-js files such as markdown etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@satya164 - Thanks for your comment! Could you give an example (or a link to one)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prettier can format a wide-range of files such as markdown files (including code inside markdown files). The ESLint config only applies to TypeScript and JS files. Not sure what kind of example you're expecting?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay never mind, I understand the reason. Thanks!

],
},
};