Skip to content

Commit dee8715

Browse files
committedOct 20, 2024·
[IMP] update dotfiles
1 parent 28c7edf commit dee8715

6 files changed

+239
-209
lines changed
 

‎.copier-answers.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: v1.26
2+
_commit: v1.27
33
_src_path: git+https://github.com/OCA/oca-addons-repo-template
44
additional_ruff_rules: []
55
ci: GitHub

‎.eslintrc.yml

-188
This file was deleted.

‎.pre-commit-config.yaml

+22-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exclude: |
55
# Files and folders generated by bots, to avoid loops
66
^setup/|/static/description/index\.html$|
77
# We don't want to mess with tool-generated files
8-
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
8+
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs|
99
# Maybe reactivate this when all README files include prettier ignore tags?
1010
^README\.md$|
1111
# Library files can have extraneous formatting (even minimized)
@@ -22,7 +22,7 @@ exclude: |
2222
(LICENSE.*|COPYING.*)
2323
default_language_version:
2424
python: python3
25-
node: "16.17.0"
25+
node: "22.9.0"
2626
repos:
2727
- repo: local
2828
hooks:
@@ -66,25 +66,35 @@ repos:
6666
- id: oca-checks-po
6767
args:
6868
- --disable=po-pretty-format
69-
- repo: https://github.com/pre-commit/mirrors-prettier
70-
rev: v2.7.1
69+
- repo: local
7170
hooks:
7271
- id: prettier
7372
name: prettier (with plugin-xml)
74-
additional_dependencies:
75-
- "prettier@2.7.1"
76-
- "@prettier/plugin-xml@2.2.0"
73+
entry: prettier
7774
args:
78-
- --plugin=@prettier/plugin-xml
75+
- --write
76+
- --list-different
77+
- --ignore-unknown
78+
types: [text]
7979
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
80-
- repo: https://github.com/pre-commit/mirrors-eslint
81-
rev: v8.24.0
80+
language: node
81+
additional_dependencies:
82+
- "prettier@3.3.3"
83+
- "@prettier/plugin-xml@3.4.1"
84+
- repo: local
8285
hooks:
8386
- id: eslint
84-
verbose: true
87+
name: eslint
88+
entry: eslint
8589
args:
8690
- --color
8791
- --fix
92+
verbose: true
93+
types: [javascript]
94+
language: node
95+
additional_dependencies:
96+
- "eslint@9.12.0"
97+
- "eslint-plugin-jsdoc@50.3.1"
8898
- repo: https://github.com/pre-commit/pre-commit-hooks
8999
rev: v4.6.0
90100
hooks:
@@ -114,7 +124,7 @@ repos:
114124
args: [--fix, --exit-non-zero-on-fix]
115125
- id: ruff-format
116126
- repo: https://github.com/OCA/pylint-odoo
117-
rev: v9.0.4
127+
rev: v9.1.3
118128
hooks:
119129
- id: pylint_odoo
120130
name: pylint with optional checks

‎.prettierrc.yml

-8
This file was deleted.

‎eslint.config.cjs

+202
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
jsdoc = require("eslint-plugin-jsdoc");
2+
3+
const config = [{
4+
plugins: {
5+
jsdoc,
6+
},
7+
8+
languageOptions: {
9+
globals: {
10+
_: "readonly",
11+
$: "readonly",
12+
fuzzy: "readonly",
13+
jQuery: "readonly",
14+
moment: "readonly",
15+
odoo: "readonly",
16+
openerp: "readonly",
17+
owl: "readonly",
18+
luxon: "readonly",
19+
},
20+
21+
ecmaVersion: 2024,
22+
sourceType: "script",
23+
},
24+
25+
rules: {
26+
"accessor-pairs": "warn",
27+
"array-callback-return": "warn",
28+
"callback-return": "warn",
29+
"capitalized-comments": ["warn", "always", {
30+
ignoreConsecutiveComments: true,
31+
ignoreInlineComments: true,
32+
}],
33+
complexity: ["warn", 15],
34+
"constructor-super": "warn",
35+
"dot-notation": "warn",
36+
eqeqeq: "warn",
37+
"global-require": "warn",
38+
"handle-callback-err": "warn",
39+
"id-blacklist": "warn",
40+
"id-match": "warn",
41+
"init-declarations": "error",
42+
"max-depth": "warn",
43+
"max-nested-callbacks": "warn",
44+
"max-statements-per-line": "warn",
45+
"no-alert": "warn",
46+
"no-array-constructor": "warn",
47+
"no-caller": "warn",
48+
"no-case-declarations": "warn",
49+
"no-class-assign": "warn",
50+
"no-cond-assign": "error",
51+
"no-const-assign": "error",
52+
"no-constant-condition": "warn",
53+
"no-control-regex": "warn",
54+
"no-debugger": "error",
55+
"no-delete-var": "warn",
56+
"no-div-regex": "warn",
57+
"no-dupe-args": "error",
58+
"no-dupe-class-members": "error",
59+
"no-dupe-keys": "error",
60+
"no-duplicate-case": "error",
61+
"no-duplicate-imports": "error",
62+
"no-else-return": "warn",
63+
"no-empty-character-class": "warn",
64+
"no-empty-function": "error",
65+
"no-empty-pattern": "error",
66+
"no-empty": "warn",
67+
"no-eq-null": "error",
68+
"no-eval": "error",
69+
"no-ex-assign": "error",
70+
"no-extend-native": "warn",
71+
"no-extra-bind": "warn",
72+
"no-extra-boolean-cast": "warn",
73+
"no-extra-label": "warn",
74+
"no-fallthrough": "warn",
75+
"no-func-assign": "error",
76+
"no-global-assign": "error",
77+
"no-implicit-coercion": ["warn", {
78+
allow: ["~"],
79+
}],
80+
"no-implicit-globals": "warn",
81+
"no-implied-eval": "warn",
82+
"no-inline-comments": "warn",
83+
"no-inner-declarations": "warn",
84+
"no-invalid-regexp": "warn",
85+
"no-irregular-whitespace": "warn",
86+
"no-iterator": "warn",
87+
"no-label-var": "warn",
88+
"no-labels": "warn",
89+
"no-lone-blocks": "warn",
90+
"no-lonely-if": "error",
91+
"no-mixed-requires": "error",
92+
"no-multi-str": "warn",
93+
"no-native-reassign": "error",
94+
"no-negated-condition": "warn",
95+
"no-negated-in-lhs": "error",
96+
"no-new-func": "warn",
97+
"no-new-object": "warn",
98+
"no-new-require": "warn",
99+
"no-new-symbol": "warn",
100+
"no-new-wrappers": "warn",
101+
"no-new": "warn",
102+
"no-obj-calls": "warn",
103+
"no-octal-escape": "warn",
104+
"no-octal": "warn",
105+
"no-param-reassign": "warn",
106+
"no-path-concat": "warn",
107+
"no-process-env": "warn",
108+
"no-process-exit": "warn",
109+
"no-proto": "warn",
110+
"no-prototype-builtins": "warn",
111+
"no-redeclare": "warn",
112+
"no-regex-spaces": "warn",
113+
"no-restricted-globals": "warn",
114+
"no-restricted-imports": "warn",
115+
"no-restricted-modules": "warn",
116+
"no-restricted-syntax": "warn",
117+
"no-return-assign": "error",
118+
"no-script-url": "warn",
119+
"no-self-assign": "warn",
120+
"no-self-compare": "warn",
121+
"no-sequences": "warn",
122+
"no-shadow-restricted-names": "warn",
123+
"no-shadow": "warn",
124+
"no-sparse-arrays": "warn",
125+
"no-sync": "warn",
126+
"no-this-before-super": "warn",
127+
"no-throw-literal": "warn",
128+
"no-undef-init": "warn",
129+
"no-undef": "error",
130+
"no-unmodified-loop-condition": "warn",
131+
"no-unneeded-ternary": "error",
132+
"no-unreachable": "error",
133+
"no-unsafe-finally": "error",
134+
"no-unused-expressions": "error",
135+
"no-unused-labels": "error",
136+
"no-unused-vars": "error",
137+
"no-use-before-define": "error",
138+
"no-useless-call": "warn",
139+
"no-useless-computed-key": "warn",
140+
"no-useless-concat": "warn",
141+
"no-useless-constructor": "warn",
142+
"no-useless-escape": "warn",
143+
"no-useless-rename": "warn",
144+
"no-void": "warn",
145+
"no-with": "warn",
146+
"operator-assignment": ["error", "always"],
147+
"prefer-const": "warn",
148+
radix: "warn",
149+
"require-yield": "warn",
150+
"sort-imports": "warn",
151+
"spaced-comment": ["error", "always"],
152+
strict: ["error", "function"],
153+
"use-isnan": "error",
154+
155+
"jsdoc/check-tag-names": "warn",
156+
"jsdoc/check-types": "warn",
157+
"jsdoc/require-param-description": "off",
158+
"jsdoc/require-return": "off",
159+
"jsdoc/require-return-description": "off",
160+
"jsdoc/require-return-type": "off",
161+
162+
"valid-typeof": "warn",
163+
yoda: "warn",
164+
},
165+
166+
settings: {
167+
jsdoc: {
168+
tagNamePreference: {
169+
arg: "param",
170+
argument: "param",
171+
augments: "extends",
172+
constructor: "class",
173+
exception: "throws",
174+
func: "function",
175+
method: "function",
176+
prop: "property",
177+
return: "returns",
178+
virtual: "abstract",
179+
yield: "yields",
180+
},
181+
preferredTypes: {
182+
array: "Array",
183+
bool: "Boolean",
184+
boolean: "Boolean",
185+
number: "Number",
186+
object: "Object",
187+
str: "String",
188+
string: "String",
189+
},
190+
},
191+
},
192+
193+
}, {
194+
files: ["**/*.esm.js"],
195+
196+
languageOptions: {
197+
ecmaVersion: 2024,
198+
sourceType: "module",
199+
},
200+
}];
201+
202+
module.exports = config

‎prettier.config.cjs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @type {import('prettier').Config} */
2+
3+
const config = {
4+
// https://github.com/prettier/prettier/issues/15388#issuecomment-1717746872
5+
plugins: [require.resolve("@prettier/plugin-xml")],
6+
bracketSpacing: false,
7+
printWidth: 88,
8+
proseWrap: "always",
9+
semi: true,
10+
trailingComma: "es5",
11+
xmlWhitespaceSensitivity: "preserve",
12+
};
13+
14+
module.exports = config;

0 commit comments

Comments
 (0)
Please sign in to comment.