forked from facebook/lexical
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP WIP Cleanup Cleanup eslint Fix Fix selection issues + text removal Fix a few bugs and add GCC compilation Remove node_modules Remove node_modules
- Loading branch information
Showing
41 changed files
with
14,754 additions
and
3,169 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 @@ | ||
packages/**/dist/*.js | ||
packages/**/config/*.js | ||
**/node_modules |
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,119 @@ | ||
'use strict'; | ||
|
||
const restrictedGlobals = require('confusing-browser-globals'); | ||
|
||
const OFF = 0; | ||
const ERROR = 2 | ||
|
||
module.exports = { | ||
extends: ['fbjs', 'prettier'], | ||
|
||
// Stop ESLint from looking for a configuration file in parent folders | ||
root: true, | ||
|
||
plugins: [ | ||
'jest', | ||
'no-for-of-loops', | ||
'no-function-declare-after-return', | ||
'react', | ||
], | ||
|
||
parser: 'babel-eslint', | ||
parserOptions: { | ||
ecmaVersion: 8, | ||
sourceType: 'script', | ||
ecmaFeatures: { | ||
experimentalObjectRestSpread: true, | ||
}, | ||
}, | ||
// We're stricter than the default config, mostly. We'll override a few rules | ||
// and then enable some React specific ones. | ||
rules: { | ||
'accessor-pairs': OFF, | ||
'brace-style': [ERROR, '1tbs'], | ||
'consistent-return': OFF, | ||
'dot-location': [ERROR, 'property'], | ||
// We use console['error']() as a signal to not transform it: | ||
'dot-notation': [ERROR, {allowPattern: '^(error|warn)$'}], | ||
'eol-last': ERROR, | ||
eqeqeq: [ERROR, 'allow-null'], | ||
indent: OFF, | ||
'jsx-quotes': [ERROR, 'prefer-double'], | ||
'keyword-spacing': [ERROR, {after: true, before: true}], | ||
'no-bitwise': OFF, | ||
'no-console': OFF, | ||
'no-inner-declarations': [ERROR, 'functions'], | ||
'no-multi-spaces': ERROR, | ||
'no-restricted-globals': [ERROR].concat(restrictedGlobals), | ||
'no-restricted-syntax': [ERROR, 'WithStatement'], | ||
'no-shadow': ERROR, | ||
'no-unused-expressions': ERROR, | ||
'no-unused-vars': [ERROR, {args: 'none'}], | ||
'no-use-before-define': OFF, | ||
'no-useless-concat': OFF, | ||
quotes: [ERROR, 'single', {avoidEscape: true, allowTemplateLiterals: true}], | ||
'space-before-blocks': ERROR, | ||
'space-before-function-paren': OFF, | ||
'valid-typeof': [ERROR, {requireStringLiterals: true}], | ||
// Flow fails with with non-string literal keys | ||
'no-useless-computed-key': OFF, | ||
|
||
// We apply these settings to files that should run on Node. | ||
// They can't use JSX or ES6 modules, and must be in strict mode. | ||
// They can, however, use other ES6 features. | ||
// (Note these rules are overridden later for source files.) | ||
'no-var': ERROR, | ||
strict: ERROR, | ||
|
||
// Enforced by Prettier | ||
// TODO: Prettier doesn't handle long strings or long comments. Not a big | ||
// deal. But I turned it off because loading the plugin causes some obscure | ||
// syntax error and it didn't seem worth investigating. | ||
'max-len': OFF, | ||
// Prettier forces semicolons in a few places | ||
'flowtype/object-type-delimiter': OFF, | ||
|
||
// React & JSX | ||
// Our transforms set this automatically | ||
'react/jsx-boolean-value': [ERROR, 'always'], | ||
'react/jsx-no-undef': ERROR, | ||
// We don't care to do this | ||
'react/jsx-sort-prop-types': OFF, | ||
'react/jsx-space-before-closing': ERROR, | ||
'react/jsx-uses-react': ERROR, | ||
'react/no-is-mounted': OFF, | ||
// This isn't useful in our test code | ||
'react/react-in-jsx-scope': ERROR, | ||
'react/self-closing-comp': ERROR, | ||
// We don't care to do this | ||
'react/jsx-wrap-multilines': [ | ||
ERROR, | ||
{declaration: false, assignment: false}, | ||
], | ||
|
||
// Prevent for...of loops because they require a Symbol polyfill. | ||
// You can disable this rule for code that isn't shipped (e.g. build scripts and tests). | ||
'no-for-of-loops/no-for-of-loops': ERROR, | ||
|
||
// Prevent function declarations after return statements | ||
'no-function-declare-after-return/no-function-declare-after-return': ERROR, | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
// We apply these settings to the source files that get compiled. | ||
// They can use all features including JSX (but shouldn't use `var`). | ||
files: 'packages/*/src/**/*.js', | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
ecmaVersion: 8, | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
'no-var': ERROR, | ||
'prefer-const': ERROR, | ||
strict: OFF, | ||
}, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
bracketSpacing: false, | ||
singleQuote: true, | ||
jsxBracketSameLine: true, | ||
trailingComma: 'es5', | ||
printWidth: 80, | ||
parser: 'babel', | ||
trailingComma: 'all', | ||
}; |
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,68 +1,3 @@ | ||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
# Outline JS | ||
|
||
## Available Scripts | ||
|
||
In the project directory, you can run: | ||
|
||
### `yarn start` | ||
|
||
Runs the app in the development mode.<br /> | ||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
|
||
The page will reload if you make edits.<br /> | ||
You will also see any lint errors in the console. | ||
|
||
### `yarn test` | ||
|
||
Launches the test runner in the interactive watch mode.<br /> | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
|
||
### `yarn build` | ||
|
||
Builds the app for production to the `build` folder.<br /> | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
|
||
The build is minified and the filenames include the hashes.<br /> | ||
Your app is ready to be deployed! | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
|
||
### `yarn eject` | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
|
||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
|
||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. | ||
|
||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. | ||
|
||
## Learn More | ||
|
||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
|
||
To learn React, check out the [React documentation](https://reactjs.org/). | ||
|
||
### Code Splitting | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting | ||
|
||
### Analyzing the Bundle Size | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size | ||
|
||
### Making a Progressive Web App | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app | ||
|
||
### Advanced Configuration | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration | ||
|
||
### Deployment | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment | ||
|
||
### `yarn build` fails to minify | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify | ||
Outline is a fast, lightweight, rich-text editor library for React. |
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,34 +1,38 @@ | ||
{ | ||
"name": "outline", | ||
"version": "0.1.0", | ||
"name": "outline-example", | ||
"description": "Outline is a fast, lightweight, rich-text editor for React", | ||
"version": "1.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/react": "^9.3.2", | ||
"@testing-library/user-event": "^7.1.2", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"react-scripts": "4.0.0" | ||
}, | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
"start": "npm run build && npm start --prefix packages/outline-example", | ||
"build": "node scripts/build.js", | ||
"build-prod": "node scripts/build.js --prod", | ||
"watch": "node scripts/build.js --watch" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
"devDependencies": { | ||
"@babel/plugin-transform-flow-strip-types": "^7.12.1", | ||
"@babel/preset-react": "^7.12.5", | ||
"@rollup/plugin-babel": "^5.2.1", | ||
"@rollup/plugin-node-resolve": "^10.0.0", | ||
"confusing-browser-globals": "^1.0.10", | ||
"eslint": "^7.12.1", | ||
"eslint-config-fbjs": "^3.1.1", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-babel": "^5.3.1", | ||
"eslint-plugin-flowtype": "^5.2.0", | ||
"eslint-plugin-jest": "^24.1.0", | ||
"eslint-plugin-jsx-a11y": "^6.4.1", | ||
"eslint-plugin-no-for-of-loops": "^1.0.1", | ||
"eslint-plugin-no-function-declare-after-return": "^1.1.0", | ||
"eslint-plugin-react": "^7.21.5", | ||
"flow": "^0.2.3", | ||
"google-closure-compiler": "^20201006.0.0", | ||
"jest": "26.6.0", | ||
"minimist": "^1.2.5", | ||
"prettier": "^2.1.2", | ||
"rollup": "^2.33.1" | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"name": "outline-emoji-plugin", | ||
"version": "1.0.0", | ||
"main": "dist/index.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
Oops, something went wrong.