-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '74d822b43dfb7bc241bb56712b6e72676541e45e' as 'extension…
…s/src/paratext-registration'
- Loading branch information
Showing
38 changed files
with
27,555 additions
and
0 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,16 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 100 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.cs] | ||
indent_size = 4 |
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,35 @@ | ||
# #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.eslintignore | ||
|
||
# Please keep this file in sync with .prettierignore and .stylelintignore | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
.idea | ||
npm-debug.log.* | ||
*.css.d.ts | ||
*.sass.d.ts | ||
*.scss.d.ts | ||
|
||
# Built files | ||
dist | ||
release | ||
temp-build | ||
|
||
# generated files | ||
package-lock.json | ||
|
||
# #endregion |
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,163 @@ | ||
// #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.eslintrc.cjs | ||
|
||
module.exports = { | ||
extends: [ | ||
// https://github.com/electron-react-boilerplate/eslint-config-erb/blob/main/index.js | ||
// airbnb rules are embedded in erb https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb | ||
'erb', | ||
// Make sure this is last so it gets the chance to override other configs. | ||
// See https://github.com/prettier/eslint-config-prettier and https://github.com/prettier/eslint-plugin-prettier | ||
'plugin:prettier/recommended', | ||
], | ||
|
||
rules: { | ||
// Some rules in this following shared region are not applied since they are overridden in subsequent regions | ||
// #region shared with https://github.com/paranext/paranext-core/blob/main/.eslintrc.js except certain overrides | ||
|
||
// #region ERB rules | ||
|
||
'import/extensions': 'off', | ||
// A temporary hack related to IDE not resolving correct package.json | ||
'import/no-extraneous-dependencies': 'off', | ||
'import/no-import-module-exports': 'off', | ||
'import/no-unresolved': 'error', | ||
'react/jsx-filename-extension': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
|
||
// #endregion | ||
|
||
// #region Platform.Bible rules | ||
|
||
// Rules in each section are generally in alphabetical order. However, several | ||
// `@typescript-eslint` rules require disabling the equivalent ESLint rule. So in these cases | ||
// each ESLint rule is turned off immediately above the corresponding `@typescript-eslint` rule. | ||
'import/no-anonymous-default-export': ['error', { allowCallExpression: false }], | ||
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }], | ||
'lines-between-class-members': 'off', | ||
'@typescript-eslint/lines-between-class-members': [ | ||
'error', | ||
'always', | ||
{ exceptAfterSingleLine: true, exceptAfterOverload: true }, | ||
], | ||
'@typescript-eslint/member-ordering': 'error', | ||
'no-empty-function': 'off', | ||
'@typescript-eslint/no-empty-function': [ | ||
'error', | ||
{ | ||
allow: ['arrowFunctions', 'functions', 'methods'], | ||
}, | ||
], | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
'no-redeclare': 'off', | ||
'@typescript-eslint/no-redeclare': 'error', | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
patterns: [ | ||
{ | ||
group: ['shared/*', 'renderer/*', 'extension-host/*', 'node/*', 'client/*', 'main/*'], | ||
message: `Importing from this path is not allowed. Try importing from @papi/core. Imports from paths like 'shared', 'renderer', 'node', 'client' and 'main' are not allowed to prevent unnecessary import break.`, | ||
}, | ||
], | ||
}, | ||
], | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': 'error', | ||
'no-use-before-define': 'off', | ||
'@typescript-eslint/no-use-before-define': [ | ||
'error', | ||
{ functions: false, allowNamedExports: true, typedefs: false, ignoreTypeReferences: true }, | ||
], | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
'no-useless-constructor': 'off', | ||
'@typescript-eslint/no-useless-constructor': 'error', | ||
'comma-dangle': ['error', 'always-multiline'], | ||
indent: 'off', | ||
'jsx-a11y/label-has-associated-control': [ | ||
'error', | ||
{ | ||
assert: 'either', | ||
}, | ||
], | ||
// Should use our logger anytime you want logs that persist. Otherwise use console only in testing | ||
'no-console': 'warn', | ||
'no-null/no-null': 2, | ||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], | ||
'no-type-assertion/no-type-assertion': 'error', | ||
'prettier/prettier': ['warn', { tabWidth: 2, trailingComma: 'all' }], | ||
'react/jsx-indent-props': ['warn', 2], | ||
'react/jsx-props-no-spreading': ['error', { custom: 'ignore' }], | ||
'react/require-default-props': 'off', | ||
|
||
// #endregion | ||
|
||
// #endregion | ||
|
||
// #region Overrides to rules from paranext-core | ||
|
||
'import/no-unresolved': ['error', { ignore: ['@papi'] }], | ||
|
||
// #endregion | ||
}, | ||
globals: { | ||
globalThis: 'readonly', | ||
}, | ||
overrides: [ | ||
{ | ||
// Allow this file to have overrides to rules from paranext-core | ||
files: ['.eslintrc.*js'], | ||
rules: { | ||
'no-dupe-keys': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.js'], | ||
rules: { | ||
strict: 'off', | ||
}, | ||
}, | ||
{ | ||
// Don't require extensions to have a default export for "activate()" | ||
files: ['*.ts'], | ||
rules: { | ||
'import/prefer-default-export': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['./lib/*', './webpack/*'], | ||
rules: { | ||
// These files are scripts not running in Platform.Bible, so they can't use the logger | ||
'no-console': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.d.ts'], | ||
rules: { | ||
// Allow .d.ts files to self import so they can refer to their types in `papi-shared-types` | ||
'import/no-self-import': 'off', | ||
}, | ||
}, | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: 'module', | ||
project: './tsconfig.lint.json', | ||
tsconfigRootDir: __dirname, | ||
createDefaultProgram: true, | ||
}, | ||
plugins: ['@typescript-eslint', 'no-type-assertion', 'no-null'], | ||
settings: { | ||
'import/resolver': { | ||
typescript: { | ||
alwaysTryTypes: true, | ||
}, | ||
}, | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx'], | ||
}, | ||
}, | ||
}; | ||
|
||
// #endregion |
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,33 @@ | ||
# #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.gitignore | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
release | ||
dist-ssr | ||
*.local | ||
|
||
# formatting and linting | ||
.eslintcache | ||
|
||
# Editor directories and files | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Temporary intermediate build files | ||
temp-build | ||
|
||
# #endregion |
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,35 @@ | ||
# #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.prettierignore | ||
|
||
# Please keep this file in sync with .eslintignore and .stylelintignore | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
.idea | ||
npm-debug.log.* | ||
*.css.d.ts | ||
*.sass.d.ts | ||
*.scss.d.ts | ||
|
||
# Built files | ||
dist | ||
release | ||
temp-build | ||
|
||
# generated files | ||
package-lock.json | ||
|
||
# #endregion |
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,19 @@ | ||
// #region shared with https://github.com/paranext/paranext-core/blob/main/.prettierrc.js and https://github.com/paranext/paranext-multi-extension-template/blob/main/.prettierrc.js | ||
|
||
module.exports = { | ||
tabWidth: 2, | ||
trailingComma: 'all', | ||
endOfLine: 'lf', | ||
singleQuote: true, | ||
// prettier-plugin-jsdoc options | ||
tsdoc: true, | ||
plugins: ['prettier-plugin-jsdoc'], | ||
overrides: [ | ||
{ | ||
files: '*.json', | ||
options: { parser: 'json' }, | ||
}, | ||
], | ||
}; | ||
|
||
// #endregion |
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,35 @@ | ||
# #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.stylelintignore | ||
|
||
# Please keep this file in sync with .eslintignore and .prettierignore | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
.idea | ||
npm-debug.log.* | ||
*.css.d.ts | ||
*.sass.d.ts | ||
*.scss.d.ts | ||
|
||
# Built files | ||
dist | ||
release | ||
temp-build | ||
|
||
# generated files | ||
package-lock.json | ||
|
||
# #endregion |
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,24 @@ | ||
// #region shared with https://github.com/paranext/paranext-core/blob/main/.stylelintrc.js and https://github.com/paranext/paranext-multi-extension-template/blob/main/.stylelintrc.cjs | ||
|
||
module.exports = { | ||
extends: [ | ||
'stylelint-config-recommended', | ||
'stylelint-config-sass-guidelines', | ||
'stylelint-config-tailwindcss/scss', | ||
], | ||
overrides: [ | ||
{ | ||
files: ['**/*.scss'], | ||
customSyntax: 'postcss-scss', | ||
}, | ||
], | ||
rules: { | ||
'color-named': null, | ||
'max-nesting-depth': 2, | ||
'no-descending-specificity': null, | ||
'selector-max-compound-selectors': 4, | ||
'selector-max-id': 1, | ||
}, | ||
}; | ||
|
||
// #endregion |
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,9 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"streetsidesoftware.code-spell-checker", | ||
"stylelint.vscode-stylelint" | ||
] | ||
} |
Oops, something went wrong.