✨ feat(nvim): create global rules for formatters and linters
This commit is contained in:
parent
676e979e53
commit
03c8969b0b
9 changed files with 72 additions and 8 deletions
7
.config/nvim/.gitignore
vendored
7
.config/nvim/.gitignore
vendored
|
@ -1,7 +0,0 @@
|
||||||
tt.*
|
|
||||||
.tests
|
|
||||||
doc/tags
|
|
||||||
.repro
|
|
||||||
foo.*
|
|
||||||
*.log
|
|
||||||
data
|
|
|
@ -2,7 +2,7 @@ local M = {}
|
||||||
|
|
||||||
function M.addWordToDictionary()
|
function M.addWordToDictionary()
|
||||||
local word = vim.fn.expand("<cword>")
|
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
|
-- Append the word to the dictionary file
|
||||||
local file = io.open(dictionary_path, "a")
|
local file = io.open(dictionary_path, "a")
|
||||||
|
|
16
.config/nvim/rules/.eslintrc.json
Normal file
16
.config/nvim/rules/.eslintrc.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
8
.config/nvim/rules/.prettierrc.json
Normal file
8
.config/nvim/rules/.prettierrc.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"printWidth": 120,
|
||||||
|
"semi": false,
|
||||||
|
"singleQuote": false
|
||||||
|
}
|
8
.config/nvim/rules/.pylintrc
Normal file
8
.config/nvim/rules/.pylintrc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[FORMAT]
|
||||||
|
max-line-length = 120
|
||||||
|
|
||||||
|
[BASIC]
|
||||||
|
indent-string = " "
|
||||||
|
|
||||||
|
[REPORTS]
|
||||||
|
output-format=colorized
|
10
.config/nvim/rules/.stylelintrc.json
Normal file
10
.config/nvim/rules/.stylelintrc.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
15
.config/nvim/rules/cspell.json
Normal file
15
.config/nvim/rules/cspell.json
Normal 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"]
|
||||||
|
}
|
8
.config/nvim/rules/rustfmt.toml
Normal file
8
.config/nvim/rules/rustfmt.toml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
imports_granularity = "Crate"
|
||||||
|
group_imports = "One"
|
||||||
|
imports_layout = "Horizontal"
|
||||||
|
|
||||||
|
max_width = 120
|
||||||
|
|
||||||
|
struct_lit_style = "Block"
|
||||||
|
enum_style = "Block"
|
6
.config/nvim/rules/stylua.toml
Normal file
6
.config/nvim/rules/stylua.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
column_width = 120
|
||||||
|
|
||||||
|
[sort_requires]
|
||||||
|
enabled = true
|
Loading…
Add table
Reference in a new issue