Skip to content

Commit

Permalink
feat!: use standard quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed May 5, 2024
1 parent 4bbdd92 commit 0083d81
Show file tree
Hide file tree
Showing 136 changed files with 1,002 additions and 1,002 deletions.
4 changes: 2 additions & 2 deletions @pob/eslint-config-typescript-react/lib/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
"use strict";

module.exports = {
extends: ['@pob/eslint-config-typescript/app'].map(require.resolve),
extends: ["@pob/eslint-config-typescript/app"].map(require.resolve),
};
28 changes: 14 additions & 14 deletions @pob/eslint-config-typescript-react/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
'use strict';
"use strict";

module.exports = {
extends: ['./rules/react', './rules/react-hooks', './rules/jsx-a11y'].map(
require.resolve,
extends: ["./rules/react", "./rules/react-hooks", "./rules/jsx-a11y"].map(
require.resolve
),

settings: {
'import/resolver': {
"import/resolver": {
node: {
extensions: ['.mjs', '.js', '.json', '.ts', '.tsx', '.d.ts', '.d.tsx'],
extensions: [".mjs", ".js", ".json", ".ts", ".tsx", ".d.ts", ".d.tsx"],
},
},
},

rules: {
'import/extensions': [
'error',
'ignorePackages',
"import/extensions": [
"error",
"ignorePackages",
{
js: 'ignorePackages',
cjs: 'ignorePackages',
mjs: 'ignorePackages',
ts: 'never',
tsx: 'never',
js: "ignorePackages",
cjs: "ignorePackages",
mjs: "ignorePackages",
ts: "never",
tsx: "never",
},
],
'react/jsx-filename-extension': ['error', { extensions: ['tsx'] }],
"react/jsx-filename-extension": ["error", { extensions: ["tsx"] }],
},
};
14 changes: 7 additions & 7 deletions @pob/eslint-config-typescript-react/lib/react-native-web.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
'use strict';
"use strict";

module.exports = {
extends: ['./react-native'].map(require.resolve),
extends: ["./react-native"].map(require.resolve),

settings: {
'import/resolver': {
"import/resolver": {
node: {
extensions: ['.js', '.web.js'],
extensions: [".js", ".web.js"],
},
},
},

rules: {
'import/no-unresolved': [
'error',
"import/no-unresolved": [
"error",
{
ignore: [
// allow react-native as it is replaced by react-native-web and typed by @types/react-native. react-native lib does not need to be installed in that case
'react-native',
"react-native",
],
},
],
Expand Down
8 changes: 4 additions & 4 deletions @pob/eslint-config-typescript-react/lib/react-native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
"use strict";

module.exports = {
extends: ['.'].map(require.resolve),
extends: ["."].map(require.resolve),

env: {
browser: true,
Expand All @@ -12,9 +12,9 @@ module.exports = {
},

settings: {
'import/resolver': {
"import/resolver": {
node: {
extensions: ['.js', '.ios.js', '.android.js'],
extensions: [".js", ".ios.js", ".android.js"],
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions @pob/eslint-config-typescript-react/lib/rules/jsx-a11y.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
"use strict";

module.exports = {
plugins: ['jsx-a11y'],
extends: ['plugin:jsx-a11y/strict'],
plugins: ["jsx-a11y"],
extends: ["plugin:jsx-a11y/strict"],
};
8 changes: 4 additions & 4 deletions @pob/eslint-config-typescript-react/lib/rules/react-hooks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';
"use strict";

module.exports = {
plugins: ['react-hooks'],
plugins: ["react-hooks"],

rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
},
};
146 changes: 73 additions & 73 deletions @pob/eslint-config-typescript-react/lib/rules/react.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
"use strict";

module.exports = {
extends: ['plugin:react/recommended', 'plugin:react/jsx-runtime'],
extends: ["plugin:react/recommended", "plugin:react/jsx-runtime"],

rules: {
// https://github.com/airbnb/javascript/issues/2829
'func-names': 'error',
"func-names": "error",

// Enforce event handler naming conventions in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
Expand All @@ -19,80 +19,80 @@ module.exports = {

// Prevent direct mutation of this.state
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
'react/no-direct-mutation-state': 'error',
"react/no-direct-mutation-state": "error",

// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
'react/button-has-type': 'error',
"react/button-has-type": "error",

// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
'react/destructuring-assignment': [
'error',
'always',
{ ignoreClassFields: false, destructureInSignature: 'always' },
"react/destructuring-assignment": [
"error",
"always",
{ ignoreClassFields: false, destructureInSignature: "always" },
],

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
'react/display-name': 'off',
"react/display-name": "off",

'react/function-component-definition': [
'error',
"react/function-component-definition": [
"error",
{
namedComponents: ['function-declaration'],
namedComponents: ["function-declaration"],
// https://github.com/airbnb/javascript/issues/2829
unnamedComponents: ['function-expression'],
unnamedComponents: ["function-expression"],
},
],

// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
'react/hook-use-state': 'error',
"react/hook-use-state": "error",

// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
'react/jsx-boolean-value': ['error', 'never', { always: [] }],
"react/jsx-boolean-value": ["error", "never", { always: [] }],

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
'react/jsx-curly-brace-presence': [
'error',
{ props: 'never', children: 'never' },
"react/jsx-curly-brace-presence": [
"error",
{ props: "never", children: "never" },
],

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
'react/jsx-curly-newline': 'off',
"react/jsx-curly-newline": "off",

// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
'react/jsx-fragments': ['error', 'syntax'],
"react/jsx-fragments": ["error", "syntax"],

// https://github.com/yannickcr/eslint-plugin-react/blob/e2eaadae316f9506d163812a09424eb42698470a/docs/rules/jsx-no-constructed-context-values.md
'react/jsx-no-constructed-context-values': 'error',
"react/jsx-no-constructed-context-values": "error",

// Prevent usage of `javascript:` URLs
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
'react/jsx-no-script-url': [
'error',
"react/jsx-no-script-url": [
"error",
[
{
name: 'Link',
props: ['to'],
name: "Link",
props: ["to"],
},
],
],

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
'react/jsx-no-undef': 'error',
"react/jsx-no-undef": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
'react/jsx-no-useless-fragment': 'error',
"react/jsx-no-useless-fragment": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
'react/jsx-pascal-case': [
'error',
"react/jsx-pascal-case": [
"error",
{
allowAllCaps: true,
ignore: [],
},
],
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
'react/jsx-sort-props': [
'error',
"react/jsx-sort-props": [
"error",
{
noSortAlphabetically: true,
reservedFirst: true,
Expand All @@ -101,80 +101,80 @@ module.exports = {
},
],
// https://github.com/yannickcr/eslint-plugin-react/blob/21e01b61af7a38fc86d94f27eb66cda8054582ed/docs/rules/no-arrow-function-lifecycle.md
'react/no-arrow-function-lifecycle': 'error',
"react/no-arrow-function-lifecycle": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
'react/no-array-index-key': 'error',
"react/no-array-index-key": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/21e01b61af7a38fc86d94f27eb66cda8054582ed/docs/rules/no-invalid-html-attribute.md
'react/no-invalid-html-attribute': 'error',
"react/no-invalid-html-attribute": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/8785c169c25b09b33c95655bf508cf46263bc53f/docs/rules/no-namespace.md
'react/no-namespace': 'error',
"react/no-namespace": "error",

// entities does not need to be escaped as color syntaxing makes it clear when it's a body or it's a property.
'react/no-unescaped-entities': 'off',
"react/no-unescaped-entities": "off",

// https://github.com/yannickcr/eslint-plugin-react/blob/c2a790a3472eea0f6de984bdc3ee2a62197417fb/docs/rules/no-unstable-nested-components.md
'react/no-unstable-nested-components': 'error',
"react/no-unstable-nested-components": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/8785c169c25b09b33c95655bf508cf46263bc53f/docs/rules/prefer-exact-props.md
'react/prefer-exact-props': 'error',
"react/prefer-exact-props": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
'react/prefer-es6-class': ['error', 'always'],
"react/prefer-es6-class": ["error", "always"],

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
'react/prefer-stateless-function': [
'error',
"react/prefer-stateless-function": [
"error",
{ ignorePureComponents: true },
],

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
'react/self-closing-comp': 'error',
"react/self-closing-comp": "error",

// https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-comp.md
'react/sort-comp': [
'error',
"react/sort-comp": [
"error",
{
order: [
'static-variables',
'static-methods',
'instance-variables',
'lifecycle',
'getters',
'setters',
'instance-methods',
'/^(on|handle).+$/',
'everything-else',
'rendering',
"static-variables",
"static-methods",
"instance-variables",
"lifecycle",
"getters",
"setters",
"instance-methods",
"/^(on|handle).+$/",
"everything-else",
"rendering",
],
groups: {
lifecycle: [
'state',
'constructor',
'getDerivedStateFromProps',
'componentWillMount',
'UNSAFE_componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
'UNSAFE_componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'UNSAFE_componentWillUpdate',
'getSnapshotBeforeUpdate',
'componentDidUpdate',
'componentDidCatch',
'componentWillUnmount',
"state",
"constructor",
"getDerivedStateFromProps",
"componentWillMount",
"UNSAFE_componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"UNSAFE_componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"UNSAFE_componentWillUpdate",
"getSnapshotBeforeUpdate",
"componentDidUpdate",
"componentDidCatch",
"componentWillUnmount",
],
rendering: ['/^render.+$/', 'render'],
rendering: ["/^render.+$/", "render"],
},
},
],

// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
'react/sort-prop-types': [
'error',
"react/sort-prop-types": [
"error",
{
noSortAlphabetically: true,
requiredFirst: false,
Expand Down
2 changes: 1 addition & 1 deletion @pob/eslint-config-typescript-react/test/Hello.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReactNode } from 'react';
import type { ReactNode } from "react";

export function Hello(props: { name: string }): ReactNode {
// eslint-disable-next-line react/destructuring-assignment
Expand Down
Loading

0 comments on commit 0083d81

Please sign in to comment.