This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: format and lint code * chore: lint files
- Loading branch information
Showing
20 changed files
with
6,342 additions
and
1,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
_site | ||
src/assets/js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
root: true, | ||
extends: ["eslint"], | ||
parserOptions: { | ||
ecmaVersion: 2022 | ||
}, | ||
rules: { | ||
|
||
// Disable eslint-plugin-node rules from eslint-config-eslint | ||
"no-process-exit": "off", | ||
"func-style": "off", | ||
"node/no-deprecated-api": "off", | ||
"node/no-extraneous-require": "off", | ||
"node/no-missing-require": "off", | ||
"node/no-unpublished-bin": "off", | ||
"node/no-unpublished-require": "off", | ||
"node/no-unsupported-features/es-builtins": "off", | ||
"node/no-unsupported-features/es-syntax": "off", | ||
"node/no-unsupported-features/node-builtins": "off", | ||
"node/process-exit-as-throw": "off", | ||
"node/shebang": "off", | ||
"node/no-extraneous-import": "off", | ||
"node/no-missing-import": "off", | ||
"node/no-unpublished-import": "off", | ||
|
||
// Disable rules that the codebase doesn't currently follow. | ||
"jsdoc/require-jsdoc": "off", | ||
"jsdoc/require-returns": "off", | ||
"jsdoc/require-param-description": "off", | ||
"jsdoc/require-param-type": "off" | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["src/playground/**/*.{js,jsx}"], | ||
plugins: ["react", "jsx-a11y"], | ||
extends: ["plugin:react/recommended", "plugin:jsx-a11y/recommended"], | ||
parserOptions: { | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
}, | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: false | ||
}, | ||
settings: { | ||
react: { | ||
version: "16.8.6" | ||
} | ||
}, | ||
rules: { | ||
"react/jsx-no-target-blank": "error", | ||
|
||
// Disable rules that the codebase doesn't currently follow. | ||
// It might be a good idea to enable these in the future. | ||
"jsx-a11y/no-onchange": "off", | ||
"react/prop-types": "off", | ||
"jsdoc/require-jsdoc": "off" | ||
} | ||
} | ||
] | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
import React from "react"; | ||
import CodeMirror from '@uiw/react-codemirror'; | ||
import CodeMirror from "@uiw/react-codemirror"; | ||
import { history } from "@codemirror/history"; | ||
import { bracketMatching } from "@codemirror/matchbrackets"; | ||
import { javascript, esLint } from '@codemirror/lang-javascript'; | ||
import { javascript, esLint } from "@codemirror/lang-javascript"; | ||
import { linter } from "../utils/codemirror-linter-extension"; | ||
import { ESLintPlaygroundTheme, ESLintPlaygroundHighlightStyle } from "../utils/codemirror-theme"; | ||
import { Linter as ESLint } from "../node_modules/eslint/lib/linter/"; | ||
import "../scss/editor.scss"; | ||
|
||
export default function CodeEditor({ codeValue, onUpdate, errors, eslintOptions, ...props}) { | ||
export default function CodeEditor({ codeValue, onUpdate, eslintOptions }) { | ||
return ( | ||
<> | ||
<CodeMirror | ||
value={codeValue} | ||
minWidth="100%" | ||
height="100%" | ||
autoFocus={true} | ||
extensions={ | ||
[ | ||
history(), | ||
bracketMatching(), | ||
linter(esLint(new ESLint(), eslintOptions), { delay: 0}), | ||
linter(esLint(new ESLint(), eslintOptions), { delay: 0 }), | ||
javascript(), | ||
ESLintPlaygroundTheme, | ||
ESLintPlaygroundHighlightStyle, | ||
ESLintPlaygroundHighlightStyle | ||
] | ||
} | ||
onChange={(value) => { | ||
onChange={value => { | ||
onUpdate(value); | ||
}} | ||
/> | ||
</> | ||
); | ||
}; | ||
} |
Oops, something went wrong.