feat(nvim): create global rules for formatters and linters

This commit is contained in:
Sergio Laín 2024-01-07 15:39:23 +01:00
parent 676e979e53
commit 03c8969b0b
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
9 changed files with 72 additions and 8 deletions

View file

@ -1,7 +0,0 @@
tt.*
.tests
doc/tags
.repro
foo.*
*.log
data

View file

@ -2,7 +2,7 @@ local M = {}
function M.addWordToDictionary()
local word = vim.fn.expand("<cword>")
local dictionary_path = require("lazyvim.util.root").get() .. "/cspell-tool.txt"
local dictionary_path = require("lazyvim.util.root").get() .. "/cspell-dictionary.txt"
-- Append the word to the dictionary file
local file = io.open(dictionary_path, "a")

View file

@ -0,0 +1,16 @@
{
"env": {
"es2021": true,
"node": true,
"browser": false
},
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"ignorePatterns": ["test/", "dist/"],
"rules": {
"prettier/prettier": "error"
}
}

View file

@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"useTabs": false,
"printWidth": 120,
"semi": false,
"singleQuote": false
}

View file

@ -0,0 +1,8 @@
[FORMAT]
max-line-length = 120
[BASIC]
indent-string = " "
[REPORTS]
output-format=colorized

View file

@ -0,0 +1,10 @@
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 2,
"selector-pseudo-element-colon-notation": "double",
"declaration-block-trailing-semicolon": "always",
"no-empty-source": null,
"color-hex-case": "lower"
}
}

View file

@ -0,0 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"language": "en",
"globRoot": ".",
"dictionaryDefinitions": [
{
"name": "cspell-dictionary",
"path": "./cspell-dictionary.txt",
"addWords": true
}
],
"dictionaries": ["cspell-dictionary"],
"ignorePaths": ["node_modules", "dist", "build", "/cspell-dictionary.txt"]
}

View file

@ -0,0 +1,8 @@
imports_granularity = "Crate"
group_imports = "One"
imports_layout = "Horizontal"
max_width = 120
struct_lit_style = "Block"
enum_style = "Block"

View file

@ -0,0 +1,6 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120
[sort_requires]
enabled = true