Местоположение
Казахстан, Алма-Атинская обл., Алматы (Алма-Ата)

Достижения

Все достижения (1)

Наибольший вклад в теги

Все теги (9)

Лучшие ответы пользователя

Все ответы (20)
  • Как VS code поменять цвет шрифта, мне не нужно менять всю тему, а только цвет переменных?

    shotlandec1980
    @shotlandec1980
    В settings.json добавляем:
    "editor.semanticTokenColorCustomizations": {
        "enabled": false
    },
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "name": "variable",
                "scope": ["variable.other.readwrite"],
                "settings": {
                    "foreground": "#cc12bc"
                }
            }
        ]
    }

    Нажмите Ctrl + Shift + P, чтобы открыть проводник команд. Введите Developer: Inspect Editor Tokens and Scopes, и вы увидите подсказку при клике на нужный атрибут.

    5ed09dceb308f792004261.gif
    Ответ написан
  • Почему не срабатывает gulp task?

    shotlandec1980
    @shotlandec1980
    gulp.task('pug', function(){
        return gulp.src("app/pug/**/*.pug")
            .pipe(plumber())
            .pipe(pug({
                pretty: true
             }))
            .pipe(prettyHtml({indent_size: 4}))
            .pipe(gulp.dest("app/"))
            .pipe(browserSync.reload({stream: true}));
    });
    Ответ написан
  • Исключить формат в Gulp 4?

    shotlandec1980
    @shotlandec1980
    [
        `${PATHS.doc}/**/*.*`,
        `${PATHS.pic}/**/*.*`,
        `!${PATHS.pic}/**/*.+(pdn|psd|ai)`
    ]

    или так (не проверял)
    https://github.com/gulpjs/glob-parent
    [
        `${PATHS.doc}/**/*.!(pdn|psd|ai)`,
        `${PATHS.pic}/**/*.*`
    ]


    или
    https://gulpjs.com/docs/en/api/src/#options
    function build() {
    	return gulp.src([
    		`${PATHS.doc}/**/*.*`,
    		`${PATHS.pic}/**/*.*`
    	  ],{
    		  ignore: `${PATHS.pic}/**/*.+(pdn|psd|ai)`
    		})
    		.pipe(gulp.dest("./dist/"));
    }

    Ответ написан
  • Конфиг файла для редактора VSCODE?

    shotlandec1980
    @shotlandec1980
    1. Beautify для форматирования javascript, JSON, CSS, Sass, и HTML.
    Расширение читает настройки из файла .jsbeautifyrc, в корне вашего проекта:
    {
    	"end_with_newline": true,
    	"eol": "\r\n",
    	"indent_char": " ",
    	"indent_size": 4,
    	"indent_with_tabs": false,
    	"preserve_newlines": false,
    	"html": {
    		"brace_style": "collapse",
    		"break_chained_methods": false,
    		"end_with_newline": true,
    		"eval_code": false,
    		"indent_body_inner_html": true,
    		"indent_char": " ",
    		"indent_handlebars": true,
    		"indent_head_inner_html": true,
    		"indent_inner_html": false,
    		"indent_level": 0,
    		"indent_scripts": "separate",
    		"indent_with_tabs": false,
    		"jslint_happy": false,
    		"keep_array_indentation": false,
    		"keep_function_indentation": false,
    		"max_preserve_newlines": 10,
    		"preserve_newlines": false,
    		"space_after_anon_function": false,
    		"space_before_conditional": true,
    		"unescape_strings": false,
    		"unformatted": [],
    		"wrap_attributes": "auto",
    		"wrap_attributes_indent_size": 0,
    		"wrap_line_length": 0,
    		"allowed_file_extensions": [
    			"htm",
    			"html",
    			"xhtml",
    			"shtml",
    			"xml",
    			"svg",
    			"dust",
    			"njk",
    			"liquid",
    			"markdown",
    			"md"
    		],
    		"extra_liners": [
    			"head",
    			"body",
    			"/html"
    		],
    		"inline": [
    			"a",
    			"abbr",
    			"area",
    			"audio",
    			"b",
    			"bdi",
    			"bdo",
    			"br",
    			"button",
    			"canvas",
    			"cite",
    			"code",
    			"data",
    			"datalist",
    			"del",
    			"dfn",
    			"em",
    			"embed",
    			"i",
    			"iframe",
    			"img",
    			"input",
    			"ins",
    			"kbd",
    			"keygen",
    			"label",
    			"map",
    			"mark",
    			"math",
    			"meter",
    			"noscript",
    			"object",
    			"output",
    			"progress",
    			"q",
    			"ruby",
    			"s",
    			"samp",
    			"select",
    			"small",
    			"span",
    			"strong",
    			"sub",
    			"sup",
    			"svg",
    			"template",
    			"textarea",
    			"time",
    			"u",
    			"var",
    			"video",
    			"wbr",
    			"text",
    			"acronym",
    			"address",
    			"big",
    			"dt",
    			"ins",
    			"strike",
    			"tt"
    		],
    		"content_unformatted": [
    			"pre",
    			"textarea"
    		],
    		"void_elements": [
    			"area",
    			"base",
    			"br",
    			"col",
    			"embed",
    			"hr",
    			"img",
    			"input",
    			"keygen",
    			"link",
    			"menuitem",
    			"meta",
    			"param",
    			"source",
    			"track",
    			"wbr",
    			"!doctype",
    			"?xml",
    			"?php",
    			"?=",
    			"basefont",
    			"isindex"
    		],
    		"js": {
    			"indent_size": 4
    		},
    		"css": {
    			"indent_size": 4
    		}
    	},
    	"css": {
    		"end_with_newline": true,
    		"indent_char": " ",
    		"indent_size": 4,
    		"max_preserve_newlines": 10,
    		"newline_between_rules": true,
    		"preserve_newlines": false,
    		"selector_separator": " ",
    		"selector_separator_newline": true,
    		"space_around_combinator": false,
    		"allowed_file_extensions": [
    			"css",
    			"scss",
    			"sass",
    			"less"
    		]
    	},
    	"js": {
    		"brace_style": "collapse,preserve-inline",
    		"break_chained_methods": false,
    		"comma_first": false,
    		"e4x": false,
    		"end_with_newline": true,
    		"indent_char": " ",
    		"indent_level": 0,
    		"indent_size": 4,
    		"indent_with_tabs": false,
    		"jslint_happy": false,
    		"keep_array_indentation": true,
    		"keep_function_indentation": true,
    		"max_preserve_newlines": 4,
    		"operator_position": "before-newline",
    		"preserve_newlines": true,
    		"space_after_anon_function": false,
    		"space_after_named_function": false,
    		"space_before_conditional": true,
    		"space_in_empty_paren": false,
    		"space_in_paren": false,
    		"unescape_strings": false,
    		"wrap_line_length": 220,
    		"allowed_file_extensions": [
    			"js",
    			"json",
    			"jshintrc",
    			"jsbeautifyrc"
    		]
    	}
    }

    В настройке редактора %APPDATA%\Code\User\settings.json, указываем, какие типы файлов, расширения или конкретные имена файлов должны быть форматированы, пример:
    {
      "beautify.language": {
        "js": {
          "type": ["javascript", "json"],
          "filename": [".jshintrc", ".jsbeautifyrc"]
          // "ext": ["js", "json"]
          // ^^ to set extensions to be beautified using the javascript beautifier
        },
        "css": ["css", "scss"],
        "html": ["htm", "html"]
        // ^^ providing just an array sets the VS Code file type
      }
    }

    Мои настройки:
    "beautify.language": {
            "js": {
                "type": [
                    "javascript",
                    "json",
                    "jsonc",
                    "js"
                ],
                "filename": [
                    ".jshintrc",
                    ".jsbeautifyrc"
                ],
                "ext": [
                    "js",
                    "json"
                ]
            },
            "css": [
                "css",
                "scss",
                "less"
            ],
            "html": [
                "htm",
                "html",
                "php",
                "swig",
                "twig",
                "pug",
                "hbs",
                "njk",
                "nunjucks",
                "handlebars",
                "md",
                "liquid",
                "markdown"
            ],
            "njk": [
                "html",
                "njk",
                "nunjucks"
            ]
        },

    2. Или Prettier, .prettierrc.json:
    {
        "printWidth": 80,
        "tabWidth": 4,
        "useTabs": true,
        "semi": true,
        "singleQuote": true,
        "quoteProps": "as-needed",
        "jsxSingleQuote": true,
        "trailingComma": "es5",
        "bracketSpacing": true,
        "jsxBracketSameLine": true,
        "arrowParens": "always",
        "proseWrap": "always",
        "htmlWhitespaceSensitivity": "css",
        "vueIndentScriptAndStyle": true,
        "endOfLine": "crlf",
        "requirePragma": true,
        "insertPragma": true,
        "overrides": [
            {
                "files": "*.js",
                "options": {
                    "printWidth": 220,
                    "tabWidth": 4,
                    "useTabs": false,
                    "requirePragma": false,
                    "insertPragma": false
                }
            },
            {
                "files": "*.json",
                "options": {
                    "tabWidth": 4,
                    "useTabs": false
                }
            },
            {
                "files": "*.php",
                "options": {
                    "printWidth": 120,
                    "tabWidth": 4,
                    "useTabs": false,
                    "singleQuote": true,
                    "trailingCommaPHP": "all",
                    "braceStyle": "1tbs",
                    "requirePragma": false,
                    "insertPragma": false
                }
            }
        ]
    }
    Ответ написан