Skip to content

Commit

Permalink
Merge branch 'main' into bug/ios-korean-delete
Browse files Browse the repository at this point in the history
  • Loading branch information
potatowagon authored Nov 11, 2024
2 parents 8fb9294 + 2bdaed5 commit fc2b18e
Show file tree
Hide file tree
Showing 1,259 changed files with 135,646 additions and 148,985 deletions.
9 changes: 7 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# NOTE: In general this should be kept in sync with .eslintignore
# NOTE: In general this should be kept in sync with .prettierignore

**/dist/**
**/config/**
**/build/**
**/npm/**
**/__tests__/integration/fixtures/**
!scripts/npm/**
**/*.js.flow
**/*.d.ts
**/playwright*/**
**/vite.config.js
**/vite.prod.config.js
**/node_modules
.ts-temp
**/.docusaurus
/playwright-report
test-results
66 changes: 54 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
const restrictedGlobals = require('confusing-browser-globals');

const OFF = 0;
const WARN = 1;
const ERROR = 2;

module.exports = {
Expand All @@ -36,7 +37,7 @@ module.exports = {
'packages/*/__tests__/**/*.?(m)js',
'packages/*/src/**/*.jsx',
],
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
allowImportExportEverywhere: true,
sourceType: 'module',
Expand All @@ -51,6 +52,8 @@ module.exports = {
// node scripts should be console logging so don't lint against that
files: ['scripts/**/*.js'],
rules: {
// https://github.com/Stuk/eslint-plugin-header/issues/39
'header/header': OFF,
'no-console': OFF,
},
},
Expand All @@ -62,6 +65,7 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@lexical/all',
],
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
Expand All @@ -70,17 +74,31 @@ module.exports = {
},
plugins: ['react', '@typescript-eslint', 'header'],
rules: {
'@lexical/rules-of-lexical': [
WARN,
/** @type import('./packages/lexical-eslint-plugin/src').RulesOfLexicalOptions */ ({
isDollarFunction: ['^INTERNAL_\\$'],
isIgnoredFunction: [
// @lexical/yjs
'createBinding',
],
isLexicalProvider: ['updateEditor'],
isSafeDollarFunction: '$createRootNode',
}),
],
'@typescript-eslint/ban-ts-comment': OFF,
'@typescript-eslint/no-this-alias': OFF,
'@typescript-eslint/no-unused-vars': [ERROR, {args: 'none'}],
'header/header': [2, 'scripts/www/headerTemplate.js'],
},
},
{
// don't lint headers in entrypoint files so we can add TypeDoc module comments
files: ['packages/**/src/index.ts'],
rules: {
'header/header': OFF,
files: [
// These aren't compiled, but they're written in module JS
'packages/lexical-playground/esm/*.mjs',
],
parserOptions: {
sourceType: 'module',
},
},
{
Expand All @@ -93,9 +111,31 @@ module.exports = {
'lexical/no-optional-chaining': OFF,
},
},
{
files: [
'packages/*/src/index.ts',
'packages/*/src/index.tsx',
'packages/lexical-react/src/*.ts',
'packages/lexical-react/src/*.tsx',
],
rules: {
'no-restricted-exports': [
'error',
{
restrictDefaultExports: {
defaultFrom: true,
direct: true,
named: true,
namedFrom: true,
namespaceFrom: true,
},
},
],
},
},
],

parser: 'babel-eslint',
parser: '@babel/eslint-parser',

parserOptions: {
ecmaFeatures: {
Expand All @@ -117,6 +157,7 @@ module.exports = {
'react',
'no-only-tests',
'lexical',
'@lexical',
],

// Stop ESLint from looking for a configuration file in parent folders
Expand All @@ -126,18 +167,18 @@ module.exports = {
rules: {
'accessor-pairs': OFF,

'brace-style': [ERROR, '1tbs'],
'consistent-return': OFF,
curly: [ERROR, 'all'],
'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'],
// Prettier forces semicolons in a few places
'flowtype/object-type-delimiter': OFF,
'ft-flow/object-type-delimiter': OFF,

'flowtype/sort-keys': ERROR,
'ft-flow/sort-keys': ERROR,

'header/header': [2, 'scripts/www/headerTemplate.js'],

Expand Down Expand Up @@ -213,7 +254,8 @@ module.exports = {

'react/jsx-tag-spacing': ERROR,

'react/jsx-uses-react': ERROR,
// This hasn't been necessary since React 17
'react/jsx-uses-react': OFF,

// We don't care to do this
'react/jsx-wrap-multilines': [
Expand All @@ -223,8 +265,8 @@ module.exports = {

'react/no-is-mounted': OFF,

// This isn't useful in our test code
'react/react-in-jsx-scope': ERROR,
// This hasn't been necessary since React 17
'react/react-in-jsx-scope': OFF,

'react/self-closing-comp': ERROR,

Expand Down
Loading

0 comments on commit fc2b18e

Please sign in to comment.