1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-07 21:47:02 +09:00

add singlequote rule to linter

This commit is contained in:
Andrew Simachev 2023-08-12 18:06:02 +02:00
parent a0ba8ed5a5
commit 089907269a
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
9 changed files with 69 additions and 63 deletions

View file

@ -5,70 +5,77 @@ module.exports = {
node: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
overrides: [],
parser: "@typescript-eslint/parser",
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
ecmaVersion: "latest",
sourceType: "module",
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ["react", "@typescript-eslint"],
plugins: ['react', '@typescript-eslint'],
rules: {
"prefer-const": "warn",
"semi": ["warn", "always"],
"quotes": "off",
"no-mixed-spaces-and-tabs": "warn",
"no-multi-spaces": "warn",
"no-unsafe-optional-chaining": "warn",
"no-useless-escape": "off",
"no-empty": "off",
"no-fallthrough": "off",
"no-case-declarations": "off",
"no-console": "off",
'prefer-const': 'warn',
'semi': ['warn', 'always'],
'quotes': [
'warn',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
}
],
'no-mixed-spaces-and-tabs': 'warn',
'no-multi-spaces': 'warn',
'no-unsafe-optional-chaining': 'warn',
'no-useless-escape': 'off',
'no-empty': 'off',
'no-fallthrough': 'off',
'no-case-declarations': 'off',
'no-console': 'off',
// unused vars
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"off",
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'off',
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": [
"error",
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': [
'error',
{
extendDefaults: true,
types: {
"{}": false,
'{}': false,
},
},
],
// react, JSX related
"jsx-quotes": ["warn", "prefer-double"],
"react/jsx-key": "off",
"react/no-find-dom-node": "off",
"react/no-unescaped-entities": "off",
"react/no-direct-mutation-state": "off",
"react/display-name": "off",
'jsx-quotes': ['warn', 'prefer-double'],
'react/jsx-key': 'off',
'react/no-find-dom-node': 'off',
'react/no-unescaped-entities': 'off',
'react/no-direct-mutation-state': 'off',
'react/display-name': 'off',
},
settings: {
react: {
version: "detect",
version: 'detect',
},
},
};

View file

@ -8,12 +8,12 @@ function processLicenses(licenses, allowedLicenses) {
// The hyphenation language patterns are licensed under the LGPL (unless otherwise noted) and copyrighted to their respective creators and maintainers.
// https://github.com/bramstein/hyphenation-patterns
if (pkg.startsWith("hyphenation.")) {
pkgLicenses = "LGPL";
if (pkg.startsWith('hyphenation.')) {
pkgLicenses = 'LGPL';
};
// Solutions developed by Anytype or Any Association are allowed
if (licenses[pkg].publisher == "Anytype" || licenses[pkg].publisher == "Any" || licenses[pkg].publisher == "Any Association") {
if (licenses[pkg].publisher == 'Anytype' || licenses[pkg].publisher == 'Any' || licenses[pkg].publisher == 'Any Association') {
return false;
};

View file

@ -22,15 +22,15 @@ const Server = require('./electron/js/server.js');
const Util = require('./electron/js/util.js');
const csp = [
"default-src 'self' 'unsafe-eval' blob: http://localhost:*",
"img-src 'self' http://*:* https://*:* data: blob: file://*",
"media-src 'self' http://*:* https://*:* data: blob: file://*",
"style-src 'unsafe-inline' http://localhost:* file://*",
"font-src data: file://* http://localhost:*",
"connect-src file://* http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data:",
"script-src-elem file: http://localhost:* https://sentry.io devtools://devtools 'unsafe-inline'",
"frame-src chrome-extension://react-developer-tools",
"worker-src 'self' 'unsafe-eval' blob: http://localhost:*",
'default-src "self" "unsafe-eval" blob: http://localhost:*',
'img-src "self" http://*:* https://*:* data: blob: file://*',
'media-src "self" http://*:* https://*:* data: blob: file://*',
'style-src "unsafe-inline" http://localhost:* file://*',
'font-src data: file://* http://localhost:*',
'connect-src file://* http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data:',
'script-src-elem file: http://localhost:* https://sentry.io devtools://devtools "unsafe-inline"',
'frame-src chrome-extension://react-developer-tools',
'worker-src "self" "unsafe-eval" blob: http://localhost:*',
];
app.commandLine.appendSwitch('ignore-connections-limit', 'localhost, 127.0.0.1');

View file

@ -61,7 +61,7 @@ const request = async (lang) => {
};
const error = error => {
console.log("Error: " + error.message);
console.log('Error: ' + error.message);
reject(error);
};

View file

@ -212,7 +212,7 @@ class Util {
};
enabledLangs () {
return [ "da-DK", "de-DE", "en-US", "es-ES", "fr-FR", "hi-IN", "id-ID", "it-IT", "no-NO", "ro-RO", "ru-RU", "uk-UA", "zh-CN", "zh-TW" ];
return [ 'da-DK', 'de-DE', 'en-US', 'es-ES', 'fr-FR', 'hi-IN', 'id-ID', 'it-IT', 'no-NO', 'ro-RO', 'ru-RU', 'uk-UA', 'zh-CN', 'zh-TW' ];
};
translate (key) {

View file

@ -1,11 +1,10 @@
'use strict';
const fs = require('fs');
const stdin = process.openStdin();
let data = "";
stdin.on('data', function(chunk) {
let data = '';
stdin.on('data', (chunk) => {
data +=chunk;
});

View file

@ -205,7 +205,7 @@ const MenuBlockLatex = observer(class MenuBlockLatex extends React.Component<I.M
isSub: true,
data: {
text: item.comment || item.symbol,
example: item.comment == "" ? false : true
example: item.comment ? true : false,
}
});
};

View file

@ -437,7 +437,7 @@ const PageMainType = observer(class PageMainType extends React.Component<I.PageC
onRelationAdd (e: any) {
const rootId = this.getRootId();
const object = detailStore.get(rootId, rootId);
const recommendedRelations = object.recommendedRelations.map(id => dbStore.getRelationById(id)).map(it => it.relationKey)
const recommendedRelations = object.recommendedRelations.map(id => dbStore.getRelationById(id)).map(it => it.relationKey);
menuStore.open('relationSuggest', {
element: '#page .section.relation #item-add',

View file

@ -1,7 +1,7 @@
module.exports = (env) => {
return {
target: "node",
mode: "production",
target: 'node',
mode: 'production',
optimization: {
minimize: false,
removeAvailableModules: false,
@ -11,7 +11,7 @@ module.exports = (env) => {
entry: './electron.js',
output: {
filename: "bundle-back.js"
filename: 'bundle-back.js'
},
module: {