{"componentChunkName":"component---src-templates-blog-post-js","path":"/2022-01-30/","result":{"data":{"site":{"siteMetadata":{"title":"Howard's Note","disqusShortname":""}},"markdownRemark":{"id":"7e5a51ac-e42c-5a6d-856c-18447dfcfe8d","html":"<p>Recently I try to learn clojure.</p>\n<p>Here are some problem noted that I face when I play in clojure &#x26; clojurescript</p>\n<h2>what is <code class=\"language-text\">.cljc</code> file</h2>\n<p>When Clojure or ClojureScript needs to load a namespace, they first look for the platform-specific file (.class then .clj on Clojure and .cljs on ClojureScript) and if not found, then they look for the .cljc file.</p>\n<p>Clojure versions >= 1.7, I can name a file foo.cljc if I want it to be available for loading with require or use both from Clojure and Clojurescript.</p>\n<p>ref <a href=\"https://stackoverflow.com/questions/38676944/basic-functionality-of-cljc-files\">here</a></p>\n<h2>custom macro linter error</h2>\n<blockquote>\n<p>ref <a href=\"https://github.com/clj-kondo/clj-kondo/issues/536\">here</a></p>\n</blockquote>\n<p>define custom config <code class=\"language-text\">:lint-as</code> treat custom macro as built-in macro:</p>\n<div class=\"gatsby-highlight\" data-language=\"clojure\"><pre class=\"language-clojure\"><code class=\"language-clojure\">\t  <span class=\"token punctuation\">{</span><span class=\"token symbol\">:lint-as</span> <span class=\"token punctuation\">{</span>rum.core/defcs clojure.core/def<span class=\"token punctuation\">}</span>\n\t   <span class=\"token symbol\">:linters</span> <span class=\"token punctuation\">{</span><span class=\"token symbol\">:unresolved-symbol</span> <span class=\"token punctuation\">{</span><span class=\"token symbol\">:exclude</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">(</span><span class=\"token function\">rum.core/defcs</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span></code></pre></div>\n<p>Also note from <a href=\"https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md\">here</a>:</p>\n<p>There is four way to setup linter config:</p>\n<ol>\n<li>home dir config in ~/.config/clj-kondo/config.edn (respects XDG<em>CONFIG</em>HOME)</li>\n<li>project config: a <code class=\"language-text\">config.edn</code> file in the <code class=\"language-text\">.clj-kondo</code> directory</li>\n<li><code class=\"language-text\">:config-paths</code> in project <code class=\"language-text\">config.edn</code>: a list of directories that provide additional config</li>\n<li>command line <code class=\"language-text\">--config</code> file or EDN arguments</li>\n<li>namespace local config using <code class=\"language-text\">:clj-kondo/config</code> metadata in the namespace form</li>\n</ol>","frontmatter":{"title":"Cljure FAQ","date":"January 30, 2022","description":null,"tags":["clojure","note"],"template":"post"}}},"pageContext":{"slug":"/2022-01-30/","previous":{"node":{"fields":{"slug":"/2021-12-16-python-data-inspect-note1/"},"frontmatter":{"date":"16 December, 2021","title":"data inspect note","tags":["python","note"]}}},"next":{"node":{"fields":{"slug":"/2022-03-24/"},"frontmatter":{"date":"24 March, 2022","title":"最近近況","tags":["life"]}}}}},"staticQueryHashes":["2841359383","3810545343","916993862"]}