mirror of
https://github.com/scratchfoundation/eslint-config-scratch.git
synced 2025-08-28 22:40:13 -04:00
style: prettier --write .
This commit is contained in:
parent
d7ffee5f62
commit
f96889d13e
13 changed files with 391 additions and 342 deletions
20
.github/workflows/deploy.yml
vendored
20
.github/workflows/deploy.yml
vendored
|
@ -15,18 +15,18 @@ jobs:
|
|||
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6
|
||||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
|
||||
with:
|
||||
cache: "npm"
|
||||
node-version-file: ".nvmrc"
|
||||
cache: 'npm'
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Info
|
||||
run: |
|
||||
cat <<EOF
|
||||
Node version: $(node --version)
|
||||
NPM version: $(npm --version)
|
||||
github.event.pull_request.head.label: ${{ github.event.pull_request.head.label }}
|
||||
github.head_ref: ${{ github.head_ref }}
|
||||
github.ref: ${{ github.ref }}
|
||||
github.workflow: ${{ github.workflow }}
|
||||
EOF
|
||||
cat <<EOF
|
||||
Node version: $(node --version)
|
||||
NPM version: $(npm --version)
|
||||
github.event.pull_request.head.label: ${{ github.event.pull_request.head.label }}
|
||||
github.head_ref: ${{ github.head_ref }}
|
||||
github.ref: ${{ github.ref }}
|
||||
github.workflow: ${{ github.workflow }}
|
||||
EOF
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
- name: Semantic Release
|
||||
|
|
6
.github/workflows/signature-assistant.yml
vendored
6
.github/workflows/signature-assistant.yml
vendored
|
@ -1,9 +1,9 @@
|
|||
name: "Signature Assistant"
|
||||
name: 'Signature Assistant'
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
pull_request_target:
|
||||
types: [opened,closed,synchronize]
|
||||
types: [opened, closed, synchronize]
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
|
@ -15,7 +15,7 @@ jobs:
|
|||
CLA-Assistant:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "CLA Assistant"
|
||||
- name: 'CLA Assistant'
|
||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
|
||||
env:
|
||||
|
|
61
README.md
61
README.md
|
@ -22,10 +22,10 @@ TODO: update this section!!!
|
|||
|
||||
The configuration is split up into several modules:
|
||||
|
||||
* `eslint-config-scratch`: The base configuration, not configured for any particular environment
|
||||
* `eslint-config-scratch/node`: Rules for targeting Node.js with ESM
|
||||
* `eslint-config-scratch/web`: Rules for targeting Scratch's supported web browsers
|
||||
* `eslint-config-scratch/react`: Rules for targeting Scratch's supported web browsers with React
|
||||
- `eslint-config-scratch`: The base configuration, not configured for any particular environment
|
||||
- `eslint-config-scratch/node`: Rules for targeting Node.js with ESM
|
||||
- `eslint-config-scratch/web`: Rules for targeting Scratch's supported web browsers
|
||||
- `eslint-config-scratch/react`: Rules for targeting Scratch's supported web browsers with React
|
||||
|
||||
These configurations are set up for the flat config format required as of `eslint@^9`.
|
||||
|
||||
|
@ -48,23 +48,24 @@ Your config files should be set up like
|
|||
|
||||
```javascript
|
||||
// scratch-project/eslint.config.mjs
|
||||
import nodeConfig from 'eslint-config-scratch/node';
|
||||
export default nodeConfig;
|
||||
import nodeConfig from 'eslint-config-scratch/node'
|
||||
|
||||
export default nodeConfig
|
||||
```
|
||||
|
||||
```javascript
|
||||
// scratch-project/src/eslint.config.mjs
|
||||
import webConfig from 'eslint-config-scratch/web';
|
||||
import webConfig from 'eslint-config-scratch/web'
|
||||
|
||||
export default [
|
||||
webConfig,
|
||||
// If you need to add or override settings:
|
||||
{
|
||||
rules: {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
];
|
||||
webConfig,
|
||||
// If you need to add or override settings:
|
||||
{
|
||||
rules: {
|
||||
// ...
|
||||
},
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
This will set up all the files in the project for linting as Node.js by default,
|
||||
|
@ -84,10 +85,10 @@ just use this:
|
|||
Scratch used very different styling rules in `eslint-config-scratch@^9` and below. If you need to use those rules, you
|
||||
can use the rule sets under `legacy/`:
|
||||
|
||||
* `eslint-config-scratch/legacy`: Legacy base configuration, not configured for any particular environment
|
||||
* `eslint-config-scratch/legacy/es6`: Legacy rules for targeting Scratch's supported web browsers
|
||||
* `eslint-config-scratch/legacy/node`: Legacy rules for targeting Node.js
|
||||
* `eslint-config-scratch/legacy/react`: Legacy rules for targeting Scratch's supported web browsers with React
|
||||
- `eslint-config-scratch/legacy`: Legacy base configuration, not configured for any particular environment
|
||||
- `eslint-config-scratch/legacy/es6`: Legacy rules for targeting Scratch's supported web browsers
|
||||
- `eslint-config-scratch/legacy/node`: Legacy rules for targeting Node.js
|
||||
- `eslint-config-scratch/legacy/react`: Legacy rules for targeting Scratch's supported web browsers with React
|
||||
|
||||
New projects should not use these rule sets. They may disappear in the future.
|
||||
|
||||
|
@ -115,16 +116,16 @@ applicable.
|
|||
|
||||
`type` is one of:
|
||||
|
||||
* `fix`: A bug fix **Causes a patch release (0.0.x)**
|
||||
* `feat`: A new feature **Causes a minor release (0.x.0)**
|
||||
* `docs`: Documentation only changes
|
||||
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
* `refactor`: A code change that neither fixes a bug nor adds a feature
|
||||
* `perf`: A code change that improves performance **May or may not cause a minor release. It's not clear.**
|
||||
* `test`: Adding missing tests or correcting existing tests
|
||||
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
||||
* `chore`: Other changes that don't modify src or test files
|
||||
* `revert`: Reverts a previous commit
|
||||
- `fix`: A bug fix **Causes a patch release (0.0.x)**
|
||||
- `feat`: A new feature **Causes a minor release (0.x.0)**
|
||||
- `docs`: Documentation only changes
|
||||
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
- `refactor`: A code change that neither fixes a bug nor adds a feature
|
||||
- `perf`: A code change that improves performance **May or may not cause a minor release. It's not clear.**
|
||||
- `test`: Adding missing tests or correcting existing tests
|
||||
- `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
||||
- `chore`: Other changes that don't modify src or test files
|
||||
- `revert`: Reverts a previous commit
|
||||
|
||||
Use the [commitizen CLI](https://github.com/commitizen/cz-cli) to make commits
|
||||
formatted in this way:
|
||||
|
@ -140,6 +141,6 @@ Now you're ready to make commits using `git cz`.
|
|||
|
||||
If you're committing a change that makes the linter more strict, or will
|
||||
otherwise require changes to existing code, ensure your commit specifies a
|
||||
breaking change. In your commit body, prefix the changes with "BREAKING CHANGE: "
|
||||
breaking change. In your commit body, prefix the changes with "BREAKING CHANGE: "
|
||||
This will cause a major version bump so downstream projects must choose to upgrade
|
||||
the config and will not break the build unexpectedly.
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
* @type {import('@commitlint/types').UserConfig}
|
||||
*/
|
||||
export default {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
ignores: [message => message.startsWith('chore(release):')]
|
||||
};
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
ignores: [message => message.startsWith('chore(release):')],
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import defaults from './lib/index.mjs';
|
||||
import defaults from './lib/index.mjs'
|
||||
|
||||
export default defaults;
|
||||
export default defaults
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
|
||||
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier/flat'
|
||||
|
||||
/**
|
||||
* @type {import('eslint').Linter.Config[]}
|
||||
*/
|
||||
const eslintConfigScratch = [
|
||||
eslintConfigPrettier, // keep this last to turn off rules that conflict with Prettier
|
||||
];
|
||||
eslintConfigPrettier, // keep this last to turn off rules that conflict with Prettier
|
||||
]
|
||||
|
||||
export default eslintConfigScratch;
|
||||
export default eslintConfigScratch
|
||||
|
|
|
@ -1,164 +1,192 @@
|
|||
import globals from 'globals';
|
||||
import babelParser from '@babel/eslint-parser';
|
||||
import path from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import js from '@eslint/js';
|
||||
import {FlatCompat} from '@eslint/eslintrc';
|
||||
import jsdoc from 'eslint-plugin-jsdoc';
|
||||
import jsdoc from 'eslint-plugin-jsdoc'
|
||||
import globals from 'globals'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import babelParser from '@babel/eslint-parser'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
import js from '@eslint/js'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
})
|
||||
|
||||
export default [
|
||||
...compat.extends('eslint:recommended'),
|
||||
jsdoc.configs['flat/recommended'],
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.commonjs
|
||||
},
|
||||
...compat.extends('eslint:recommended'),
|
||||
jsdoc.configs['flat/recommended'],
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.commonjs,
|
||||
},
|
||||
|
||||
parser: babelParser,
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'script',
|
||||
parser: babelParser,
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'script',
|
||||
|
||||
parserOptions: {
|
||||
requireConfigFile: false
|
||||
}
|
||||
parserOptions: {
|
||||
requireConfigFile: false,
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
'array-callback-return': [2],
|
||||
'block-scoped-var': [2],
|
||||
curly: [2, 'multi-line'],
|
||||
'dot-location': [2, 'property'],
|
||||
'dot-notation': [2],
|
||||
eqeqeq: [2],
|
||||
'no-alert': [2],
|
||||
'no-div-regex': [2],
|
||||
'no-else-return': [2],
|
||||
'no-eq-null': [2],
|
||||
'no-eval': [2],
|
||||
'no-extend-native': [2],
|
||||
'no-extra-bind': [2],
|
||||
'no-global-assign': [2],
|
||||
'no-implied-eval': [2],
|
||||
'no-invalid-this': [2],
|
||||
'no-iterator': [2],
|
||||
'no-lone-blocks': [2],
|
||||
'no-loop-func': [2],
|
||||
'no-multi-spaces': [2],
|
||||
'no-multi-str': [2],
|
||||
'no-new': [2],
|
||||
'no-proto': [2],
|
||||
'no-return-assign': [2],
|
||||
'no-script-url': [2],
|
||||
'no-self-compare': [2],
|
||||
'no-sequences': [2],
|
||||
'no-throw-literal': [2],
|
||||
'no-unmodified-loop-condition': [2],
|
||||
'no-unused-expressions': [2],
|
||||
'no-useless-call': [2],
|
||||
'no-useless-concat': [2],
|
||||
'no-useless-escape': [2],
|
||||
'no-warning-comments': [0],
|
||||
'no-with': [2],
|
||||
radix: [2],
|
||||
'wrap-iife': [2],
|
||||
yoda: [2],
|
||||
|
||||
'no-unused-vars': [
|
||||
2,
|
||||
{
|
||||
args: 'after-used',
|
||||
varsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
|
||||
rules: {
|
||||
'array-callback-return': [2],
|
||||
'block-scoped-var': [2],
|
||||
'curly': [2, 'multi-line'],
|
||||
'dot-location': [2, 'property'],
|
||||
'dot-notation': [2],
|
||||
'eqeqeq': [2],
|
||||
'no-alert': [2],
|
||||
'no-div-regex': [2],
|
||||
'no-else-return': [2],
|
||||
'no-eq-null': [2],
|
||||
'no-eval': [2],
|
||||
'no-extend-native': [2],
|
||||
'no-extra-bind': [2],
|
||||
'no-global-assign': [2],
|
||||
'no-implied-eval': [2],
|
||||
'no-invalid-this': [2],
|
||||
'no-iterator': [2],
|
||||
'no-lone-blocks': [2],
|
||||
'no-loop-func': [2],
|
||||
'no-multi-spaces': [2],
|
||||
'no-multi-str': [2],
|
||||
'no-new': [2],
|
||||
'no-proto': [2],
|
||||
'no-return-assign': [2],
|
||||
'no-script-url': [2],
|
||||
'no-self-compare': [2],
|
||||
'no-sequences': [2],
|
||||
'no-throw-literal': [2],
|
||||
'no-unmodified-loop-condition': [2],
|
||||
'no-unused-expressions': [2],
|
||||
'no-useless-call': [2],
|
||||
'no-useless-concat': [2],
|
||||
'no-useless-escape': [2],
|
||||
'no-warning-comments': [0],
|
||||
'no-with': [2],
|
||||
'radix': [2],
|
||||
'wrap-iife': [2],
|
||||
'yoda': [2],
|
||||
'no-catch-shadow': [2],
|
||||
'no-shadow': [2],
|
||||
'no-undefined': [2],
|
||||
'no-use-before-define': [2],
|
||||
strict: [2, 'never'],
|
||||
'array-bracket-spacing': [2, 'never'],
|
||||
'block-spacing': [2, 'always'],
|
||||
'brace-style': [2],
|
||||
|
||||
'no-unused-vars': [2, {
|
||||
args: 'after-used',
|
||||
varsIgnorePattern: '^_'
|
||||
}],
|
||||
camelcase: [
|
||||
2,
|
||||
{
|
||||
properties: 'never',
|
||||
},
|
||||
],
|
||||
|
||||
'no-catch-shadow': [2],
|
||||
'no-shadow': [2],
|
||||
'no-undefined': [2],
|
||||
'no-use-before-define': [2],
|
||||
'strict': [2, 'never'],
|
||||
'array-bracket-spacing': [2, 'never'],
|
||||
'block-spacing': [2, 'always'],
|
||||
'brace-style': [2],
|
||||
'comma-dangle': [2, 'never'],
|
||||
'comma-spacing': [2],
|
||||
'comma-style': [2],
|
||||
'eol-last': [2, 'always'],
|
||||
'func-call-spacing': [2, 'never'],
|
||||
'func-style': [2, 'expression'],
|
||||
indent: [2, 4],
|
||||
'jsx-quotes': [2, 'prefer-double'],
|
||||
|
||||
'camelcase': [2, {
|
||||
properties: 'never'
|
||||
}],
|
||||
'key-spacing': [
|
||||
2,
|
||||
{
|
||||
beforeColon: false,
|
||||
afterColon: true,
|
||||
mode: 'strict',
|
||||
},
|
||||
],
|
||||
|
||||
'comma-dangle': [2, 'never'],
|
||||
'comma-spacing': [2],
|
||||
'comma-style': [2],
|
||||
'eol-last': [2, 'always'],
|
||||
'func-call-spacing': [2, 'never'],
|
||||
'func-style': [2, 'expression'],
|
||||
'indent': [2, 4],
|
||||
'jsx-quotes': [2, 'prefer-double'],
|
||||
'keyword-spacing': [
|
||||
2,
|
||||
{
|
||||
before: true,
|
||||
after: true,
|
||||
},
|
||||
],
|
||||
|
||||
'key-spacing': [2, {
|
||||
beforeColon: false,
|
||||
afterColon: true,
|
||||
mode: 'strict'
|
||||
}],
|
||||
'linebreak-style': [2, 'unix'],
|
||||
|
||||
'keyword-spacing': [2, {
|
||||
before: true,
|
||||
after: true
|
||||
}],
|
||||
'max-len': [
|
||||
2,
|
||||
{
|
||||
code: 120,
|
||||
tabWidth: 4,
|
||||
ignoreUrls: true,
|
||||
},
|
||||
],
|
||||
|
||||
'linebreak-style': [2, 'unix'],
|
||||
'new-parens': [2],
|
||||
'newline-per-chained-call': [2],
|
||||
'no-lonely-if': [2],
|
||||
'no-mixed-operators': [2],
|
||||
|
||||
'max-len': [2, {
|
||||
code: 120,
|
||||
tabWidth: 4,
|
||||
ignoreUrls: true
|
||||
}],
|
||||
'no-multiple-empty-lines': [
|
||||
2,
|
||||
{
|
||||
max: 2,
|
||||
maxBOF: 0,
|
||||
maxEOF: 0,
|
||||
},
|
||||
],
|
||||
|
||||
'new-parens': [2],
|
||||
'newline-per-chained-call': [2],
|
||||
'no-lonely-if': [2],
|
||||
'no-mixed-operators': [2],
|
||||
'no-negated-condition': [2],
|
||||
'no-tabs': [2],
|
||||
|
||||
'no-multiple-empty-lines': [2, {
|
||||
max: 2,
|
||||
maxBOF: 0,
|
||||
maxEOF: 0
|
||||
}],
|
||||
'no-trailing-spaces': [
|
||||
2,
|
||||
{
|
||||
skipBlankLines: true,
|
||||
},
|
||||
],
|
||||
|
||||
'no-negated-condition': [2],
|
||||
'no-tabs': [2],
|
||||
'no-unneeded-ternary': [2],
|
||||
'object-curly-spacing': [2],
|
||||
|
||||
'no-trailing-spaces': [2, {
|
||||
skipBlankLines: true
|
||||
}],
|
||||
'object-property-newline': [
|
||||
2,
|
||||
{
|
||||
allowMultiplePropertiesPerLine: true,
|
||||
},
|
||||
],
|
||||
|
||||
'no-unneeded-ternary': [2],
|
||||
'object-curly-spacing': [2],
|
||||
'one-var': [2, 'never'],
|
||||
'operator-linebreak': [2, 'after'],
|
||||
'quote-props': [2, 'consistent-as-needed'],
|
||||
|
||||
'object-property-newline': [2, {
|
||||
allowMultiplePropertiesPerLine: true
|
||||
}],
|
||||
quotes: [
|
||||
2,
|
||||
'single',
|
||||
{
|
||||
allowTemplateLiterals: true,
|
||||
avoidEscape: true,
|
||||
},
|
||||
],
|
||||
|
||||
'one-var': [2, 'never'],
|
||||
'operator-linebreak': [2, 'after'],
|
||||
'quote-props': [2, 'consistent-as-needed'],
|
||||
|
||||
'quotes': [2, 'single', {
|
||||
allowTemplateLiterals: true,
|
||||
avoidEscape: true
|
||||
}],
|
||||
|
||||
'semi': [2, 'always'],
|
||||
'semi-spacing': [2],
|
||||
'space-before-function-paren': [2, 'always'],
|
||||
'space-in-parens': [2],
|
||||
'space-infix-ops': [2],
|
||||
'space-unary-ops': [2],
|
||||
'spaced-comment': [2]
|
||||
}
|
||||
}
|
||||
];
|
||||
semi: [2, 'always'],
|
||||
'semi-spacing': [2],
|
||||
'space-before-function-paren': [2, 'always'],
|
||||
'space-in-parens': [2],
|
||||
'space-infix-ops': [2],
|
||||
'space-unary-ops': [2],
|
||||
'spaced-comment': [2],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
import globals from 'globals';
|
||||
import globals from 'globals'
|
||||
|
||||
export default [{
|
||||
export default [
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node
|
||||
}
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
'global-require': [2],
|
||||
'handle-callback-err': [2],
|
||||
'no-mixed-requires': [2],
|
||||
'no-new-require': [2],
|
||||
'no-path-concat': [2]
|
||||
}
|
||||
}];
|
||||
'global-require': [2],
|
||||
'handle-callback-err': [2],
|
||||
'no-mixed-requires': [2],
|
||||
'no-new-require': [2],
|
||||
'no-path-concat': [2],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,85 +1,100 @@
|
|||
import react from 'eslint-plugin-react';
|
||||
import path from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import js from '@eslint/js';
|
||||
import {FlatCompat} from '@eslint/eslintrc';
|
||||
import react from 'eslint-plugin-react'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
import js from '@eslint/js'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
})
|
||||
|
||||
export default [...compat.extends('plugin:react/recommended'), {
|
||||
export default [
|
||||
...compat.extends('plugin:react/recommended'),
|
||||
{
|
||||
plugins: {
|
||||
react
|
||||
react,
|
||||
},
|
||||
|
||||
rules: {
|
||||
'react/display-name': [2],
|
||||
'react/forbid-prop-types': [2],
|
||||
'react/no-children-prop': [2],
|
||||
'react/no-danger': [2],
|
||||
'react/no-danger-with-children': [2],
|
||||
'react/no-deprecated': [2],
|
||||
'react/no-did-mount-set-state': [2],
|
||||
'react/no-did-update-set-state': [2],
|
||||
'react/no-direct-mutation-state': [2],
|
||||
'react/no-find-dom-node': [2],
|
||||
'react/no-is-mounted': [2],
|
||||
'react/display-name': [2],
|
||||
'react/forbid-prop-types': [2],
|
||||
'react/no-children-prop': [2],
|
||||
'react/no-danger': [2],
|
||||
'react/no-danger-with-children': [2],
|
||||
'react/no-deprecated': [2],
|
||||
'react/no-did-mount-set-state': [2],
|
||||
'react/no-did-update-set-state': [2],
|
||||
'react/no-direct-mutation-state': [2],
|
||||
'react/no-find-dom-node': [2],
|
||||
'react/no-is-mounted': [2],
|
||||
|
||||
'react/no-multi-comp': [2, {
|
||||
ignoreStateless: true
|
||||
}],
|
||||
'react/no-multi-comp': [
|
||||
2,
|
||||
{
|
||||
ignoreStateless: true,
|
||||
},
|
||||
],
|
||||
|
||||
'react/no-render-return-value': [2],
|
||||
'react/no-set-state': [0],
|
||||
'react/no-string-refs': [2],
|
||||
'react/no-unescaped-entities': [2],
|
||||
'react/no-unknown-property': [2],
|
||||
'react/no-unused-prop-types': [2],
|
||||
'react/prefer-es6-class': [2],
|
||||
'react/prefer-stateless-function': [2],
|
||||
'react/prop-types': [2],
|
||||
'react/react-in-jsx-scope': [2],
|
||||
'react/require-optimization': [0],
|
||||
'react/require-render-return': [2],
|
||||
'react/self-closing-comp': [2],
|
||||
'react/sort-comp': [2],
|
||||
'react/style-prop-object': [2],
|
||||
'react/jsx-boolean-value': [2, 'never'],
|
||||
'react/jsx-closing-bracket-location': [2, 'line-aligned'],
|
||||
'react/jsx-curly-spacing': [2],
|
||||
'react/jsx-equals-spacing': [2],
|
||||
'react/jsx-filename-extension': [2],
|
||||
'react/jsx-first-prop-new-line': [2, 'multiline'],
|
||||
'react/jsx-handler-names': [2],
|
||||
'react/jsx-indent': [2],
|
||||
'react/jsx-indent-props': [2],
|
||||
'react/jsx-key': [2],
|
||||
'react/no-render-return-value': [2],
|
||||
'react/no-set-state': [0],
|
||||
'react/no-string-refs': [2],
|
||||
'react/no-unescaped-entities': [2],
|
||||
'react/no-unknown-property': [2],
|
||||
'react/no-unused-prop-types': [2],
|
||||
'react/prefer-es6-class': [2],
|
||||
'react/prefer-stateless-function': [2],
|
||||
'react/prop-types': [2],
|
||||
'react/react-in-jsx-scope': [2],
|
||||
'react/require-optimization': [0],
|
||||
'react/require-render-return': [2],
|
||||
'react/self-closing-comp': [2],
|
||||
'react/sort-comp': [2],
|
||||
'react/style-prop-object': [2],
|
||||
'react/jsx-boolean-value': [2, 'never'],
|
||||
'react/jsx-closing-bracket-location': [2, 'line-aligned'],
|
||||
'react/jsx-curly-spacing': [2],
|
||||
'react/jsx-equals-spacing': [2],
|
||||
'react/jsx-filename-extension': [2],
|
||||
'react/jsx-first-prop-new-line': [2, 'multiline'],
|
||||
'react/jsx-handler-names': [2],
|
||||
'react/jsx-indent': [2],
|
||||
'react/jsx-indent-props': [2],
|
||||
'react/jsx-key': [2],
|
||||
|
||||
'react/jsx-max-props-per-line': [2, {
|
||||
maximum: 1
|
||||
}],
|
||||
'react/jsx-max-props-per-line': [
|
||||
2,
|
||||
{
|
||||
maximum: 1,
|
||||
},
|
||||
],
|
||||
|
||||
'react/jsx-no-bind': [2, {
|
||||
ignoreRefs: true
|
||||
}],
|
||||
'react/jsx-no-bind': [
|
||||
2,
|
||||
{
|
||||
ignoreRefs: true,
|
||||
},
|
||||
],
|
||||
|
||||
'react/jsx-no-comment-textnodes': [2],
|
||||
'react/jsx-no-duplicate-props': [2],
|
||||
'react/jsx-no-target-blank': [2],
|
||||
'react/jsx-no-undef': [2],
|
||||
'react/jsx-no-comment-textnodes': [2],
|
||||
'react/jsx-no-duplicate-props': [2],
|
||||
'react/jsx-no-target-blank': [2],
|
||||
'react/jsx-no-undef': [2],
|
||||
|
||||
'react/jsx-pascal-case': [2, {
|
||||
allowAllCaps: true
|
||||
}],
|
||||
'react/jsx-pascal-case': [
|
||||
2,
|
||||
{
|
||||
allowAllCaps: true,
|
||||
},
|
||||
],
|
||||
|
||||
'react/jsx-tag-spacing': [2],
|
||||
'react/jsx-uses-react': [2],
|
||||
'react/jsx-uses-vars': [2],
|
||||
'react/jsx-wrap-multilines': [2]
|
||||
}
|
||||
}];
|
||||
'react/jsx-tag-spacing': [2],
|
||||
'react/jsx-uses-react': [2],
|
||||
'react/jsx-uses-vars': [2],
|
||||
'react/jsx-wrap-multilines': [2],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,42 +1,50 @@
|
|||
export default [{
|
||||
export default [
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {},
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'script'
|
||||
globals: {},
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'script',
|
||||
},
|
||||
|
||||
rules: {
|
||||
'arrow-body-style': [2, 'as-needed'],
|
||||
'arrow-parens': [2, 'as-needed'],
|
||||
'arrow-body-style': [2, 'as-needed'],
|
||||
'arrow-parens': [2, 'as-needed'],
|
||||
|
||||
'arrow-spacing': [2, {
|
||||
before: true,
|
||||
after: true
|
||||
}],
|
||||
'arrow-spacing': [
|
||||
2,
|
||||
{
|
||||
before: true,
|
||||
after: true,
|
||||
},
|
||||
],
|
||||
|
||||
'no-prototype-builtins': [2],
|
||||
'no-confusing-arrow': [2],
|
||||
'no-duplicate-imports': [2],
|
||||
'no-return-await': [2],
|
||||
'no-template-curly-in-string': [2],
|
||||
'no-useless-computed-key': [2],
|
||||
'no-useless-constructor': [2],
|
||||
'no-useless-rename': [2],
|
||||
'no-var': [2],
|
||||
'prefer-arrow-callback': [2],
|
||||
'no-prototype-builtins': [2],
|
||||
'no-confusing-arrow': [2],
|
||||
'no-duplicate-imports': [2],
|
||||
'no-return-await': [2],
|
||||
'no-template-curly-in-string': [2],
|
||||
'no-useless-computed-key': [2],
|
||||
'no-useless-constructor': [2],
|
||||
'no-useless-rename': [2],
|
||||
'no-var': [2],
|
||||
'prefer-arrow-callback': [2],
|
||||
|
||||
'prefer-const': [2, {
|
||||
destructuring: 'all'
|
||||
}],
|
||||
'prefer-const': [
|
||||
2,
|
||||
{
|
||||
destructuring: 'all',
|
||||
},
|
||||
],
|
||||
|
||||
'prefer-promise-reject-errors': [2],
|
||||
'prefer-rest-params': [2],
|
||||
'prefer-spread': [2],
|
||||
'prefer-template': [2],
|
||||
'require-atomic-updates': [2],
|
||||
'require-await': [2],
|
||||
'rest-spread-spacing': [2, 'never'],
|
||||
'symbol-description': [2],
|
||||
'template-curly-spacing': [2, 'never']
|
||||
}
|
||||
}];
|
||||
'prefer-promise-reject-errors': [2],
|
||||
'prefer-rest-params': [2],
|
||||
'prefer-spread': [2],
|
||||
'prefer-template': [2],
|
||||
'require-atomic-updates': [2],
|
||||
'require-await': [2],
|
||||
'rest-spread-spacing': [2, 'never'],
|
||||
'symbol-description': [2],
|
||||
'template-curly-spacing': [2, 'never'],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,27 +1,25 @@
|
|||
import sortImports from '@trivago/prettier-plugin-sort-imports';
|
||||
import sortImports from '@trivago/prettier-plugin-sort-imports'
|
||||
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
const prettierConfig = {
|
||||
// #region Prettier
|
||||
arrowParens: 'avoid',
|
||||
bracketSameLine: false,
|
||||
bracketSpacing: true,
|
||||
plugins: [
|
||||
sortImports
|
||||
],
|
||||
printWidth: 118,
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
tabWidth: 2,
|
||||
trailingComma: 'all',
|
||||
// #endregion Prettier
|
||||
// #region Prettier
|
||||
arrowParens: 'avoid',
|
||||
bracketSameLine: false,
|
||||
bracketSpacing: true,
|
||||
plugins: [sortImports],
|
||||
printWidth: 118,
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
tabWidth: 2,
|
||||
trailingComma: 'all',
|
||||
// #endregion Prettier
|
||||
|
||||
// #region @trivago/prettier-plugin-sort-imports
|
||||
importOrder: ['^@', '^[./]']
|
||||
// #endregion @trivago/prettier-plugin-sort-imports
|
||||
};
|
||||
// #region @trivago/prettier-plugin-sort-imports
|
||||
importOrder: ['^@', '^[./]'],
|
||||
// #endregion @trivago/prettier-plugin-sort-imports
|
||||
}
|
||||
|
||||
export default prettierConfig;
|
||||
export default prettierConfig
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
module.exports = {
|
||||
extends: 'scratch-semantic-release-config',
|
||||
branches: [
|
||||
{
|
||||
name: 'master'
|
||||
// default channel
|
||||
}
|
||||
]
|
||||
};
|
||||
extends: 'scratch-semantic-release-config',
|
||||
branches: [
|
||||
{
|
||||
name: 'master',
|
||||
// default channel
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
|
||||
|
||||
"extends": [
|
||||
"github>scratchfoundation/scratch-renovate-config:js-lib"
|
||||
]
|
||||
extends: ['github>scratchfoundation/scratch-renovate-config:js-lib'],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue